zamp0e Posted June 2, 2009 Share Posted June 2, 2009 Hello! I'd like a tip for how to solve this problem: After my INSERT string have been executed, if I refresh the page the INSERT goes of again. The INSERT is exectuted after I submit a form, showing a new page and inserting new data in the database, and it is when I refresh this page that I get a new input in my db. So how should I fix this ? Maybe clear the variables after the INSERT or something, I don't know how to do that and I don't know if it would solve the problem. Any help would be highly appreciated! Link to comment https://forums.phpfreaks.com/topic/160630-solved-clear-variables/ Share on other sites More sharing options...
zer0day Posted June 2, 2009 Share Posted June 2, 2009 After the data is inserted into the database, you could redirect the user to another page, or the same page. echo '<META HTTP-EQUIV="Refresh" Content="0; URL=your-page-here.php">'; Hope this helps! Link to comment https://forums.phpfreaks.com/topic/160630-solved-clear-variables/#findComment-847687 Share on other sites More sharing options...
zamp0e Posted June 2, 2009 Author Share Posted June 2, 2009 Thanks, It solved the problem, however, is there any way to delay echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">'; with about 5 seconds ? Just so people have time to see the other page? Link to comment https://forums.phpfreaks.com/topic/160630-solved-clear-variables/#findComment-847692 Share on other sites More sharing options...
zer0day Posted June 2, 2009 Share Posted June 2, 2009 echo '<META HTTP-EQUIV="Refresh" Content="5; URL=your-page-here.php">'; Link to comment https://forums.phpfreaks.com/topic/160630-solved-clear-variables/#findComment-847694 Share on other sites More sharing options...
zamp0e Posted June 2, 2009 Author Share Posted June 2, 2009 Worked like a charm, thanks alot! Link to comment https://forums.phpfreaks.com/topic/160630-solved-clear-variables/#findComment-847697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.