I have PHP code that allows users to give feedback. Right now after the enter a comment it just displays a message, instead, I'd like for the code to reload the page.
For example, they are on item.php?itemID=10 page and add a comment, I'd like it to enter their info into the DB, then take them to item.php?itemID=10 again...
Here's my code:
if (sizeof($errorList) == 0)
{
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "INSERT INTO comment(comment_date, comment_name, comment_email, comment_website, comment_entry, blogID) VALUES(NOW(), '$comment_name', '$comment_email', '$comment_website', '$comment_entry', 1)";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// print result
echo "<font face='Tahoma, Verdana, Arial, Helvetica, sans-serif' color='#000000' size='1'>This news item has been added, go back <a href='index.php'>home</a>.</font>";
// close database connection
mysql_close($connection);