MDanz Posted September 10, 2009 Share Posted September 10, 2009 this is a 30 second submit button inbetween. You have to wait 30 seconds to inbetween using it. <html> <head> <script type='text/javascript'> var doSomething = function(){ var ele = document.getElementById("submitButton"); if(ele.disabled){ ele.disabled = false; }else{ ele.disabled = true; setTimeout("doSomething()", 30000); } } </script> </head> <body> <form enctype='multipart/form-data' action='insert.php' method='post' name='changer'> <input type='button' onclick='doSomething();' id='submitButton' value='GO' /> </form> </body> </html> It works. The problem i'm having is if i leave the page the time is lost. So say i press the button, the timer starts, button unavailable. Then i go to another page and come back under 30 seconds. The button is available to press. How do i log the time? Link to comment https://forums.phpfreaks.com/topic/173763-help-with-form/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 10, 2009 Share Posted September 10, 2009 In your other thread on this same problem it was pointed out that sessions/cookies can not be used because they are dependent on the browser, so the visitor has the ability to delete the piece of information that you are relying on. Nothing you do in the browser with javascrpt will work either, for the same reason, you cannot control or rely on anything that the visitor does with his browser. You can only rely on what your server side scripting language is doing to detect and limit the time between submissions. A lot of undesirable information that gets posted to pages comes from bot scripts anyway. There is no browser involved at all so attempting to use any method that is relying on how a browser works is going to be a waste of time. Link to comment https://forums.phpfreaks.com/topic/173763-help-with-form/#findComment-915974 Share on other sites More sharing options...
MDanz Posted September 10, 2009 Author Share Posted September 10, 2009 wouldn't that way take up alot of bandwidth? because it is logging in mysql everytime a user presses submit ? if thats the only way then i'll do it that way. thx Link to comment https://forums.phpfreaks.com/topic/173763-help-with-form/#findComment-915978 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.