Thursday, July 30, 2009

Calling PHP functions from Javascript using/via AJAX

This has been quite a topic for some time - the ability for PHP functions to be called from Javascript. Well, yesterday I did it by implementing this feature into Samstyle PHP Framework.

This is similar to ASP.NET AJAX Extension's Webservice, where you can directly call Methods in classes of your ASP.NET website.

Download and experiment with this new feature at http://code.google.com/p/samstyle-php-framework/. Only available in the framework after version 1.2.6 BETA.

But again remember, PHP is a server-side script, which shouldn't have access from a client-side script like javascript. here we're doing AJAX calls back to the server to call the function.

No comments: