AJAX in Action: A Demo on How to Submit Data w/ AJAX and PHP
Posted: Sun Mar 19, 2006 4:51 am
I have played around a bit with Gregory Wild-Smith's AJAX framework (found at: ). This is the same one you are using for AJAX Display Dynamic Articles script.
His framework alone is pretty straight forward, however I modified it slightly to use JavaScript arrays to hold the form field names (making it easier to change).
I also have a basic "action.php" page that receives the data via AJAX and updates a database. On this page, I am using a special variable $ajaxAction so that it may be used for multiple form page submissions (simply push a different Action to the page as shown in the script).
AJAX in Action
Overall, this is a very simple demonstration on how to update a database using AJAX and PHP, and is VERY easy to modify for anyone's needs!!
You can download a zip of the script and demo here:
Additionally, if you feel that this would benefit visitors of your site, feel free to modify and/or put it up on your site!! Note: I included Gregory's "sack-license" in the zip (as it uses his AJAX framework).
Best Regards,
MIKE