Fooling around with AJAX has been on my web programming to-do list for quite some time — like years. I’ve read bits and pieces on it, but I never had the right project come along at the right time. Finally the planets aligned. With a series of 15 google calendars, and my task is to make one web page that will allow users to easily navigate between them. You can see the first working prototype here. I created a table in MySQL that holds the information on each of the calendars, and a PHP script that delivers the proper Google embed code based which calendar is selected.
One of the things that kept me from trying AJAX was the idea that it would be too complex — boy was I wrong there. I struggled most with the Javascript (I just find PHP so much easier to work with!) The html page and javascript on the client end are matched with PHP on the server. In my past work I used PHP to deliver full pages — now it just delivers whatever content is needed to fill in some element on the page. It is actually less work than feeding full pages. Very cool. If you’ve been holding off yourself here are some examples to get your started. Always remember to sanitize your user input — even if you don’t accept user input directly any POST or GET call is an opportunity for the injection of bad stuff.
Build an Ajax Dropdown Menu – Webmonkey
In the course of this tutorial, we’re going to look at what Ajax can do. Then we’ll use a JavaScript class to simplify your first steps toward the ultimate in speedy user interactivity.
The following example will demonstrate how a web page can fetch information from a database with AJAX technology.
How to sanitize your php input
A php class that makes sure your php input is clean…Never trust user input, it may be malicious, always check your php input.

ADD YOUR COMMENT
Comments are moderated.
Randall Rode's online home for thoughts, notes, and experiments with a wide range of technology topics. Visit the about page for info on my recent projects and professional background. I welcome your comments!
New articles are normally posted on Mondays and Wednesdays. Subscribe to the RSS feed or the email update to keep current on the latest posts.