this is a comments form : <form name="form1" method="post" action="<? echo $site_url?>/index.php?id=<? echo $_GET[id];?>&task=add_comment"> <p> <textarea name="comment" cols="50" rows="4" id="comment" class="TEXTAREA"></textarea> <br><input type="submit" name="Submit" value="Add Comment" class="btn" /> </p> </form> PHP: and this is where it should do the action : <?php include ('secure.php'); $comment = no_injection($_POST['comment']); $id = no_injection($_GET['id']); mysql_query("INSERT INTO ava_comments (user, comment, link_id) VALUES ('$userid', '$comment', '$id')"); header("Location: $site_url/index.php?task=view&id=$_GET[id]"); ?> PHP: but it shows this error when you visit the add_comment.php but it does add the comment but why does this message show up? please reply asap!
I tried to change that but it doesnt work... so i have to give a goback to play option ! if you can help me it would be great !
<?php ob_start(); include ('secure.php'); $comment = no_injection($_POST['comment']); $id = no_injection($_GET['id']); mysql_query("INSERT INTO ava_comments (user, comment, link_id) VALUES ('$userid', '$comment', '$id')"); header("Location: $site_url/index.php?task=view&id=$_GET[id]"); ob_flush(); ?> PHP: Try that, hope it works.
Try this: <?php include ('secure.php'); $comment = no_injection($_POST['comment']); $id = no_injection($_GET['id']); mysql_query("INSERT INTO ava_comments (user, comment, link_id) VALUES ('$userid', '$comment', '$id')"); echo "<meta http-equiv=\"refresh\" content=\"0; url=http://{$site_url}/index.php?task=view&id={$id}" \">"; ?> PHP: It's a hack, but should work fine.