Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About wadesmart

  • Rank
  1. I had just found that missing & right before you posted. It never fails. I can look for hours and as soon as I ask for help - I see the problem. But, it still wasnt working so it def helps to spell things correctly HAA Thanks Larry. Much appreciated - as usual Wade
  2. Ive been using what Ive learned this book for a long time now but Im stumped on something. I have a situation where I can not use a drop down list so I was going to use a links instead. link: href="index.php?p=performances?performance=Life_After_50" Im stumped as how to handle this code. In the index.php page I see the code: //Validate what page to show if(isset($_GET['p'])){ $p = $_GET['p']; } else if( isset($_POST['p'])) { //form $p = $_POST['p']; } else { $p = NULL; } But how does the page get redirected back to the performances.inc.php to access the perfor
  3. FOUND IT!!! header("Content-Type=text/xml"); should be header("Content-Type:text/xml"); Changed that - its all fine. OMGOSH that is crazy that one little thing like a = instead of a : can do that. Ok.. thanks for the help - moving on with the book
  4. Ok.. I noticed it only did that with the php tag at the top and thought maybe the page logic inserted the dashes itself but the above test says it didnt. Anyway, I dont know why that showed up but its not in my actual code.
  5. Im just looked at that.... the <!-- isnt in my code. Its only in the code I posted here. This is what I have <?php #add_employee_xml.php header("Content-Type=text/xml"); echo '<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <response> ';
  6. Hartley, Im working with the code right out of the book that this forum is named after: //add_employee.js window.onload = init; function init(){ var ajax = getXMLHttpRequestObject(); if(ajax){ if(document.getElementById('results')){ document.getElementById('emp_form').onsubmit = function(){ ajax.open('post', 'add_employee_xml.php'); ajax.onreadystatechange = function() { handleResponse(ajax); } var fields = ['first_name', 'last_name', 'email', 'department_id', 'phone_ext']; for(var i = 0; i < fields.length; i++){ fields[i] = fields[i] + '=' + encodeURIComponent(doc
  7. Ok. Thanks for you response Larry. After looking through the book and over the code, I dont understand how to do that yet. Ill just put this book away until I understand js better.
  8. Do you mean with this: if(ajax.readyState == 4){ if((ajax.status == 200) || (ajax.status == 304)) { which is inside the function handleResponse(ajax).
  9. var errors = data.getElementsByTagName('error'); When I run the page my Firefox error console says: data is null add_employee.js line 44 -> which is the above line. I checked my code against that downloaded from the site and found no errors so I ran the code from the site and had the same issue. Ive been going over the code to see if I understand what is happening but I just dont understand js enough and what could be causing the errors. wade
  • Create New...