AJAX server-side PHP script “getajax.php
The PHP script which we used to support our AJAX client #1 example above is very simple:
<?php echo "<IMG src='http://www.jdcampbell.com/14.gif'><br>This is an Ajax/PHP response.<br>What do you think?<br>"; ?>
Place the above text in a file named “getajax.php” on your PHP Web server and it’ll work just fine. However, if you use it with our client #1 example, you will need to change the web address to your server within the function doHttpRequest() near the top of the client #1 HTML document.
Look for Part 2 of this tutorial on “Advanced AJAX used with PHP” for more AJAX technology. Primarily what we will be discussing in future articles is database operations with AJAX requests, and XML document download and usage via AJAX, and maybe a few other related issues. See you then!