I am having an issue with ajax sending values to my PHP script for processing.
Here is the simplified ajax I am using;
$.post("register_user.php", { lastname: "gather", username: "johnny" } );
This is the PHP Code:
$lastname = $_POST['lastname'];
$username = $_POST['username'];
**** Mysql Insert into DB code Here *****
My situation is more complex with more values to be sent, but what am I doing wrong? I have pin pointed it to the Ajax because when I put in values manually instead of the $_POST vars in the PHP it works fine. It is loading the page correctly because my php script sends blank values to the database.
Please help! Here is my last post regarding the issue: http://stackoverflow.com/questions/1250157/jquery-ajax-issue
EDIT
I have changed the code and put serialize in it. It successfully gets all of the form fields but it is not posting to the database, it is throwing blanks still. I know my PHP code is good. Firebug says 304 Not Modified.