Jump to content

Archived

This topic is now archived and is closed to further replies.

newman

php query

Recommended Posts

hi all .
how can i query my database without reloading the page . i read some tutorials about PHP and AJAX . but i didnot understand the solution .

Share this post


Link to post
Share on other sites
Does [a href=\"http://members.aol.com/barryaandrew/xmlhttp/article.html\" target=\"_blank\"]this[/a] help?

Share this post


Link to post
Share on other sites
thank you so much for your useful tutorial , but when I use the JS code blow i get a javascript error : [b]unepected indetifier[/b]


[code]
function handleMessages (url, resultID) {
  var obj;
  xmlhttp.open("GET", url, true);
  xmlhttp. {
       if (xmlhttp.readyState==4) {
            obj = document.getElementById(resultID);
            obj.innerHTML = xmlhttp.responseText;
       }
  }
xmlhttp.send();
return 0;
}

[/code]


what's the problem ?

Share this post


Link to post
Share on other sites
Is it because part of the code is missing?

[code]function handleMessages (url, resultID) {
  var obj;
  xmlhttp.open("GET", url, true);
  xmlhttp.onreadystatechange=function() {        // <--  misssing code
       if (xmlhttp.readyState==4) {
            obj = document.getElementById(resultID);
            obj.innerHTML = xmlhttp.responseText;
       }
  }
xmlhttp.send();
return 0;
}[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.