Jump to content

Preventing resubmission of a system command if page (i.e. script) is reloaded...


cgm225

Recommended Posts

when yourefresh the page it will have the message warning page contain post data something like that right because it really has.

 

now to avoid this use header

 

header('location:yourlocation.php');

 

from that the post data are gone because the page are freshly reloaded so when you click refresh

you wont get the same message again :-* :-* :-*

 

Link to comment
Share on other sites

Oh ok.. let me clarify my question.. because it was poorly asked!

 

If I have a bunch of system commands, and as they run the script takes a long time to run* (i.e. to the user, it appears to be taking a long time to load/pausing), and so the user refreshes while it is still in the middle of running some system commands.  Are there techniques for preventing resubmission of the system commands the script already ran before it was refreshed?

 

 

*An example would be if I was using system commands to generate a bunch of thumbnails..

 

Thank you in advance!

Link to comment
Share on other sites

i dont think there is even in js i dont think if onload is possible but you can have the header file to keep that long waiting out of scene or use the db

 

heres how upon submit get the data and time and compare the time interval in the matter of secon then if the time if just less than second perform a script that delete the entry and tell the user that that refreshing while on load is invalid

Link to comment
Share on other sites

but when you reset it will also reset all the content of the page or reload it again

 

say by this example

<?php

if(isset(SYSTEM COMMAND)){

    //don't reset it

}else{

    //reset it

}

?>

now when you reset this will be true }else{ this will be false right???

 

when you submit it just the same as this ^^^

 

so ???

Link to comment
Share on other sites

seems like no body wants to react any way another explanation

 

<?php

if(isset(SYSTEM COMMAND)){//issue no 1

    //don't reset it

}else{issue no 2

    //reset it

}

?>

1 when you reload issue no 1 will be set again

2 when you reload issue no 2 will be false again

 

or as if you will have the session that will only be use once like upon submit you will have the session counter for that person that will allow him to submit with the specified time like the difference between the miliseconds of submission

Link to comment
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.