Hello, I'm trying to post a serialized form to a sumbit.php file, in turn, will then insert into a MySQL database; however, the last input which is hidden, is not getting inserted into the database, though the rest are.
Here's some snippet examples of what I've got thus far which is not working:
HTML
<form method="post" action="" >
<label for="name" class="overlay"><span>Name...</span></label>
<input class="input-text" type="text" name="name" id="name" />
<label for="email" class="overlay"><span>Email...</span></label>
<input type="text" class="input-text" name="email" id="email"/>
<label for="website" class="overlay"><span>Website...</span></label>
<input type="text" class="input-text" name="website" id="website"/>
<label id="body-label" for="body" class="overlay"><span>Comment it up...</span></label>
<textarea class="input-text" name="body" id="body" cols="20" rows="5"></textarea>
<input type="hidden" name="parentid" id="parentid" value="0" />
<input type="submit" value="Comment" name="submit" id="comment-submit" />
</span>
</form>
Javascript
$('form.').submit(function(event) {
$.post('submit.php',$(this).serialize(),function(msg){
// form inputs consist of 5 values total: name, email, website, text, and a hidden input that has the value of an integer
}
});
PHP (submit.php)
$arr = array();
mysql_query(" INSERT INTO comments(name,email,website,body,parentid)
VALUES (
'".$arr['name']."',
'".$arr['email']."',
'".$arr['website']."',
'".$arr['body']."',
'".$arr['parentid']."'
)");