<form action="index.php" method="POST" id="form">
<input type="text" name="guest" id="guest_name" class="textbox"/><br />
<textarea name="textarea" id="text" class="textarea"></textarea/><br />
<input type="submit" id="submit" class="submit"/><br />
</form>
Jquery
$.post("events.php?action=send", { data : $("#form").serialize() }, function(data, error) { }
Tested if post DATA has the data in it:
echo var_dump($_POST['data']);
I get this:
name=blabla&comment=blabla1
And then when I do
echo $_POST['guest'];
Nothing comes up, it's a NULL.
Question:
What have I done wrong? Why doesn't the POST guest get filled? if it's in DATA, and form's method is POST too.
Thanks!
datafield in your JQuery that you are getting it like that in PHP. Try getting rid of thedata :part in the post function so the data will be past to the$_POSTarray as expected.