Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About leso9903

  • Rank
  1. Hello, I'm receiving this: "Strict Standards: Creating default object from empty value in /opt/lampp/htdocs/uppgift6/pizzeria.html on line 40" When I try to type out some attributes from an xml-document. As I've understood it I'm putting something in an empty variable(?) - how do I fix this. <?phpinclude_once("JSON.php");$json = new Services_JSON();$pizzeria = "pizzeria.xml";$writedir = "writehere";$pizzeria = $writedir."/pizzeria.xml";$sxe = simplexml_load_file($pizzeria);$result = array();foreach ($sxe->menu->pizza as $pizza->ingredient) { // $result[] = (string)$pizza->
  2. I made it work with trial and error but the manuals doesn't make sense to me. Can I tell you how I think it works, then you correct me? the following code, for example: foreach ($sxe->menu->pizza as $pizza->ingredient) { $result[] = (string)$pizza->ingredient["units"];} foreach is a loop $sxe is my root - is it possible to skip one step, for example $sxe->pizza (I skipped $menu)? I know it works in some cases but why does it work? As for the 'as' part I've no clue. $result[] is telling the engine that it is an array and will keep going until every targeted node has been pro
  3. Hello, I've been trying to print out data from an array but I dont understand the code I'm working with.. A part of the xml file is seen down below. How do I only get the description or the name for example to be printed out in my html-file? In other words, my problem is that all the data gets printed out, I only want specific data. <?xml version="1.0" encoding="utf-8"?><pizzeria> <menu> <pizza id="5"> <name>Al tonno</name> <description>A simple pie with Tunafish</description> <popularity>50</popularity> <
  4. Hello, first off I wanted to thank you guys for helping me this far. I've posted a couple of times here and I got my questions answered and my problems fixed. I hope I can return the favour when I'm abit more knowledgable. Anyway, I'm working on a registration form and I've implemented some animation effects such as the input field turning red on click when there is no data inserted. I'd like to know how to keep the red input field even after the page has loaded. I've noticed that the inserted data inside the input fields are still there after I've updated the page - I'd like the same for
  5. Hello, I'd like to know if it's possible to set several conditions for an else if statement. This I know I can do: if (X==" ") {blabla} else {} But I'd like several statements like so: if (X==" " and Y==5 and Z==6) {blabla } else {} How do I do that?
  6. Thanks. solved using $("#bla:bla").val(result.name);
  7. Hello, how do I put values inside an input box onclick? I've data from JSON. For example, if I want to put data inside a div element i just do: document.getElementById("#fullname").innerHTML=result.name; How do I do the corresponding to an input-box? It doesn't work if I just put the input-box's id. Should I put .value() somewhere? The name of the JSON array is result and the objects inside the array is named ssn, name, street etc. I want to click a button (later on I'll take the value from the input box itself), look up the data inside the JSON array and fill in rest of the registrat
  8. Thanks alot you guys for answering. Thing is, I'm doing this webprogramming course and the AJAX assignment is actually before the PHP tutorial..
  9. Hello I'm suppose to create a registration form that searches through a php-file and comments "entry not found" when the wrong social security is typed. I've no clue what I'm doing but atleast I got a apache server started... What should I type in my jscript file? The php-script that I'm suppose to use don't contain any data, I'm confused.. HTML <html> <head><script type="text/javascript" src="scripts.js"></script> </head> <body> <?php echo date('c'); ?> </p> <form name="form" action="" method="post"> <fi
  10. Hi, I followed a tutorial on and I wrote exactly as he did but it still doesn't work. i also want to know where I can find a tutorial that you went through to create a registration form which includes social security number, name, adress and so on, as well as password visibility, username taken etc<!DOCTYPE><html><head> <script src="movies.js"></script></head><body onload="createList()"> Here are my favorite movies: <br/> <div id="divMovies"></div></body></html> JS function createList(){ var s; s = "<ul>" + <
  11. It works! thank you very very much. I've a followup question. say I want to have an animation that changes the opacity from 0 to 1 and vice versa. How would I go about doing that? I've changed the code a bit but it's basically what I got from you.. function mainmenu(){$(" #nav ul ").css({display: "none"}); // Opera Fix$(" #nav li").hover(function(){ $(this).children('ul').stop(true,true).slideDown("linear"); },function(){ $(this).children('ul').stop(true,true).slideUp("linear"); });} $(document).ready(function(){ mainmenu(); }) I changed slideUp/slideDown to opacity 1/0: function mainme
  12. Now, that's the code I'm looking for, however, it doesn't work for me..I think the target doesn't work or something?
  13. Hello, I've tried to do a Jquery dropdown on a menu but it only works one time. Is there any kind of toggle or something I should use instead. Do you have any soutions to a multilevel dropdown submenu? I'm very new to Jquery.. <ul> <li><a href="#">BlA</a></li> <li><a href="#">HTML</a></li> <li class="css"><a href="#">CSS</a> <ul class="subcss"> <li><a href="#">Box Model</a></li> <li><a href="#">Pseudo Classes</a></li> </ul></li> <!-- </li
  14. Hi, I just started doing some javascript with jquery and I can't seem to make the code work.. I don't think javascript is "on" sort of speak. What have I done wrong? The tutorial is here: http://blog.themeforest.net/screencasts/jquery-for-absolute-beginners-video-series/ <!DOCTYPE html><html><head><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script><link rel="stylesheet" href="html.css" type="text/css"></head><body><div id="box"></div><a href="#"> click me! </a>&
  15. I tried #picture { position:relative; float: right; right: 20px; bottom: 160px;} but I'm not sure if that was a good solution.. I had to figure out the size of the picture and then place it accordingly..
  • Create New...