Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.