News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Batchelder's Blog:
Writing Your Server-Side Ajax Handler
March 23, 2006 @ 12:37:17

Matthew Batchelder describes in his latest post about the other half of an equation he demonstrated in this previous post - the creation of an Ajax handler.

In my recent post on 'Ajax; Templating; and the Separation of Layout and Logic,' I refer to an Ajax Handler that sits server side to handle Ajax calls. Some elaboration is in order.

As I have stated in the past, I'm a huge fan of Prototype AND I choose PHP as my language of choice...so my examples will be using both, but the idea is portable.

His example is a very basic one, pulling in the data from the $_GET values and, with a combination of dynamic function calls and the use of eval(), provides a simple "framework" to handle your Ajax calls. There are two versions of the same thing - one using if statements and the other a switch and various cases.

0 comments voice your opinion now!
ajax server-side handler if statement switch dynamic function ajax server-side handler if statement switch dynamic function


blog comments powered by Disqus

Similar Posts

Developer.com: Developing a Ajax-driven Shopping Cart with PHP and Prototype

Andy Bakun's Blog: Race Conditions with Ajax and PHP Sessions

SomeCoders.com: Member Managment System Using PHP, AJAX and script.aculo.us (Part 2)

Jim Plush\'s Blog: New AJAX/PHP framework - My-BIC is LIGHT and TASTY!

Gonzalo Ayuso's Blog: New features in PHP5.4 alpha1


Community Events





Don't see your event here?
Let us know!


laravel composer tool series interview library install voicesoftheelephpant podcast framework symfony security language opinion introduction community release update package version

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework