in your previous page save the $_SERVER['QUERY_STRING']; into a session var
and in the next page:
PHP Code:
<?php
session_start();
$ref = $_SESSION['ref'];
$con = mysql_connect("localhost", "myusername", "mypassword");
mysql_select_db("jokesdb", $con);
$comment = mysql_real_escape_string($_POST['comment']);
$sql = "INSERT INTO comments (comment) VALUES ('$comment')";
echo "Comment has been made";
mysql_close($con);
?>
<html>
<head>
<script language="JavaScript">
var time = null
function move() {
window.location = "<?php echo $ref ?>";
}
//-->
</script>
</head>
<body onload="timer=setTimeout('move()',1000)">
<h2>Redirecting back to main</h2>
</body>
</html>
Bookmarks