In doing a project for backlinks in php, I came across a problem. When a link is saved in database then if user reload the page, the script re-save the data. So I want a solution that on reloading browser the post data should not save. I searched for it but could not find some proper solution. Here is what i did:
<?php
if(!isset($_REQUEST['ok']))
{
// database query to save post data...
Header("Location: same_page.php?ok=true");
}
?>
So when you send header on same page but with a request variable which set now this time, it will not allow the query to save same information again. So on hitting reload the form will not submit and you can also stay on the same page.
Note: If you use this method and do not send a request variable, then it will become infinite loop.
Here are some other to try:
Use a meta refresh,
You can also just add a session variable when the form has been submitted successfully. Then on the same time check if the session variable is set before you resubmit the form.
Then it would not matter if the same post data is resubmit, since the session variable would be set.
Searched By:
inurl:/viewthread?thread= powered by vbulletin see description below (7), php do not allow resend (5), touch inurl:/form php (5), inurl:/viewthread?thread= powered by vbulletin entire site updated (5), inurl:/viewthread?thread= powered by vbulletin natural capital includes (4), inurl:/viewthread?thread= powered by vbulletin sell other companies products (4), inurl:/viewthread?thread= powered by vbulletin science writers association (3), inurl:/viewthread?thread= powered by vbulletin replacement programs for itunes (3), inurl:/viewthread?thread= powered by vbulletin discount dance supply discounts (3), powered by vBulletin discount (2), inurl:/viewthread?thread= powered by vbulletin second hand smoke (2), php resubmission (2), inurl:/viewthread?thread= powered by vbulletin engineering company in texas (2), inurl:/pages/forum-thread-form malingerers (2), powered by vBulletin how to check (2), powered by vBulletin engineering services (1), wordpress prevent form resubmission (1), php prevent resubmit session (1), php resend same data (1), php resend stop (1)Related posts:
Great website you have here but i seem to be having a problem downloading your RSS feed. Everytime i click it it comes up with error 734. It might be my own desktop. I have Windows xp with Norton AntiVirus. Im not sure if its enabled. Let me know if anyone else has mentioned any Problems or its just me. Im not too good with netbooks. I cant see my message after submitting so im not sure if you will see this. Ill bookmark your site and check by in a couple of days for a response. Please let me know if you know of a fix
I myself using windows xp and I don’t have such error. Every thing is working fine. May be your virus settings are preventing rss to load…!