Hi guys,
I was wondering if it was possible to call a specific PHP function using AJAX instead of calling a whole page. An example:
function MakeRequest()
{
var xmlHttp = getXMLHTTP();
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
document.getElementById('provinceDiv').innerHTML =
xmlHttp.responseText;
}
}
xmlHttp.open("GET", "FindProvinces.php", true);
xmlHttp.send(null);
}
I already have a PHP function (in a class) that retrieves the provinces/states from the database based on the country. I was wondering if it was possible to call this function instead of having to make a new file (in this case FindProvinces.php) that calls the function. Thanks in advance.