crimsonmoon Posted May 29, 2007 Share Posted May 29, 2007 I want to make it where every user can only access a certain script every 5 seconds. Would a session be the best way. Any examples anyone could share? Just trying to make sure that someone doesn't click so fast the script runs twice. Quote Link to comment https://forums.phpfreaks.com/topic/53394-lock-script-for-5-secs-for-certain-user/ Share on other sites More sharing options...
ToonMariner Posted May 29, 2007 Share Posted May 29, 2007 you can't stop them clicking twice - if they click refresh the same will happen and you won't be able to disable that. Once a new request is sent then the old one is 'deleted' so I woudl not worry too much about it. Quote Link to comment https://forums.phpfreaks.com/topic/53394-lock-script-for-5-secs-for-certain-user/#findComment-263816 Share on other sites More sharing options...
taith Posted May 29, 2007 Share Posted May 29, 2007 the only thing i can think of, would be to make a javascript function, that onclick of a link, usets all the other links href="" tags... so you click, it disables everything, loads new page... Quote Link to comment https://forums.phpfreaks.com/topic/53394-lock-script-for-5-secs-for-certain-user/#findComment-263824 Share on other sites More sharing options...
crimsonmoon Posted May 29, 2007 Author Share Posted May 29, 2007 I just need to compare and make sure that user X has loaded this page within the past 5 seconds. Could I compare a PHP time variable maybe. I don't care if they run in more than once but I just want to keep it from running so fast that the script runs before I'm able to change the variables. Quote Link to comment https://forums.phpfreaks.com/topic/53394-lock-script-for-5-secs-for-certain-user/#findComment-263922 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.