Jump to content

Problem with Refreshing page


kjanceski

Recommended Posts

Hi. I've made a simple forum something like messageboard and I have problem when i refresh page. Here is some of the code:

$conn=mysql_connect("","","");
$sqlQuery="select * from forum";
mysql_select_db("",$conn);
if (isset($_POST['submit'])&&!isset($_POST['refresh']))
{
if (($_POST['name'])!="" &&($_POST['message'])!="")
{
	$name=$_POST['name'];
	$message=$_POST['message'];
	$timezone=2;
                $time=time();
                $gmttime= gmdate("M d Y H:i:s", $time);
                $convertedtime=date("M d Y H:i:s",strtotime("$timezone hours",strtotime($gmttime)));
   		$e="INSERT INTO forum (name,message,time) VALUES ( '$name','$message','$convertedtime')";
	mysql_query($e);		
}		
}

When you press refresh button on the browser it says that there is POST variables and if you press OK then the same message is added to the database. I partly solve the problem by addind refresh button. I want to know is there any other solution for this problem.

Link to comment
https://forums.phpfreaks.com/topic/51990-problem-with-refreshing-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.