- Impact
- 12
Hi can someone help me in adding a page id to the database in this php comment system tutorial
tutorial: http://tutorialzine.com/2010/06/simple-ajax-commenting-system/
I have added a extra field in the database table called "page_id"
on the demo.php page i have added:
and also included a extra hidden field:
and then in the submit.php file my insert looks like
for some reason its not working, if someone can help it will be much appreciated!
Thanks!
tutorial: http://tutorialzine.com/2010/06/simple-ajax-commenting-system/
I have added a extra field in the database table called "page_id"
on the demo.php page i have added:
PHP:
$id=$_GET['id'];
and also included a extra hidden field:
PHP:
<label for="page_id"></label>
<input type="text" id="page_id" name="page_id" value="<?php echo $id;?>" />
and then in the submit.php file my insert looks like
PHP:
mysql_query(" INSERT INTO comments(name,url,email,body,page_id)
VALUES (
'".$arr['name']."',
'".$arr['url']."',
'".$arr['email']."',
'".$arr['body']."','
'".$arr['page_id']."','
)");
$arr['dt'] = date('r',time());
$arr['id'] = mysql_insert_id();
for some reason its not working, if someone can help it will be much appreciated!
Thanks!