kjanceski Posted May 18, 2007 Share Posted May 18, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/51990-problem-with-refreshing-page/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.