Site Cloner PHP Script
Bargain Hunter PHP Script
Job Hunter PHP Script
Site Login and Access Control PHP Script

Ajax Basics

Using ajax is a very fast method to retrieve data from a database with a php file.

1) create a request object (looks like PHP oop)
var=new XMLHttpRequest();

2) Send a request to the server with open() and send() methods
xmlhttp.open(“GET”,”myfile.php?q=”+str,true);
xmlhttp.send();

3) response from server Use responseText for string from server or responseXML as xml data
//3A. SET / STORES A FUNCTION (or the name of a function) to be called automatically each time the readyState property changes 
xmlhttp.onreadystatechange=function()  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
//3B. RESPONSE FROM SERVER
document.getElementById(“txtHint”).innerHTML=xmlhttp.responseText;
    }
  }