asmith Posted January 8, 2008 Share Posted January 8, 2008 hey guys assume a script takes 30 sec to run completely. a user will click the button , and the script would run. now at the 15th sec of the script , if the user click again on the button (if available) , what happens to the previous script ? for example this script ( assume it takes 30 sec , each sql command takes 1 second) insert into table1(name) value ('name1') insert into table1(name) value ('name2') insert into table1(name) value ('name3') . . . what happens if the user click at the middle of the running script ? Quote Link to comment https://forums.phpfreaks.com/topic/85062-middle-of-a-script/ Share on other sites More sharing options...
rhodesa Posted January 8, 2008 Share Posted January 8, 2008 Depends on your ignore_user_abort setting in php.ini Visit http://us2.php.net/ignore_user_abort for more information Quote Link to comment https://forums.phpfreaks.com/topic/85062-middle-of-a-script/#findComment-433795 Share on other sites More sharing options...
asmith Posted January 8, 2008 Author Share Posted January 8, 2008 what ? what ignore_user_abort has to do with my question ? Quote Link to comment https://forums.phpfreaks.com/topic/85062-middle-of-a-script/#findComment-433824 Share on other sites More sharing options...
rhodesa Posted January 8, 2008 Share Posted January 8, 2008 I assumed you were talking about a PHP script that does 30 seconds of processing. And, while the page is loading (processing) in a browser, they push the refresh 'button'. This basically means they are issuing an abort, then asking for the page again. What am I missing here? Quote Link to comment https://forums.phpfreaks.com/topic/85062-middle-of-a-script/#findComment-433835 Share on other sites More sharing options...
asmith Posted January 8, 2008 Author Share Posted January 8, 2008 maybe an "abort" for the user, but the script wont be aborted by pressing refresh button. however the 'button' can be a submit button on page , and an impatience user there can not wait for 30 secs, and click on it again and again . Quote Link to comment https://forums.phpfreaks.com/topic/85062-middle-of-a-script/#findComment-433841 Share on other sites More sharing options...
rhodesa Posted January 8, 2008 Share Posted January 8, 2008 If you are referring to a normal form (not one submitted with ajax), the form should submit only once. Clicking the Submit button over and over shouldn't post multiple pages. (As far as I know) Quote Link to comment https://forums.phpfreaks.com/topic/85062-middle-of-a-script/#findComment-433845 Share on other sites More sharing options...
Stooney Posted January 8, 2008 Share Posted January 8, 2008 How about just disabling the submit button on submit? Quote Link to comment https://forums.phpfreaks.com/topic/85062-middle-of-a-script/#findComment-433857 Share on other sites More sharing options...
Stooney Posted January 8, 2008 Share Posted January 8, 2008 <input type="submit" value="Submit" onclick="this.disabled=true;"> Quote Link to comment https://forums.phpfreaks.com/topic/85062-middle-of-a-script/#findComment-433878 Share on other sites More sharing options...
asmith Posted January 9, 2008 Author Share Posted January 9, 2008 <input type="submit" value="Submit" onclick="this.disabled=true;"> that works and i have it on my page , but it is JAVA and can be disabled , i want to deal with impatience users that got no JAVA . i still don't know what happens if the user click on the submit button in the middle of the previous script running ??? ? Quote Link to comment https://forums.phpfreaks.com/topic/85062-middle-of-a-script/#findComment-434328 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.