Kingy Posted January 16, 2008 Share Posted January 16, 2008 Is there any way to halt php... I have made irc statistics using php/mysql and whilst in the irc room people can type `top10 to see who the top10 posters are, what i would like to stop is people flooding.. I have placed a sleep(10) at the bottom off the top10 command but all that does is wait 10 seconds then it will keep going through the top10 just waiting for 10seconds before doing each one.. making the bot useless until it has finished going through them all. What i would like it to do is disable that command completely for 10 seconds and if someone tries to use it display something like "Please wait 10 seconds before using this command again", but i still want to be able to use the other commands. Any ideas about doing this, or is this a bit to much Quote Link to comment https://forums.phpfreaks.com/topic/86383-solved-halting-php/ Share on other sites More sharing options...
revraz Posted January 17, 2008 Share Posted January 17, 2008 Java Script Quote Link to comment https://forums.phpfreaks.com/topic/86383-solved-halting-php/#findComment-441458 Share on other sites More sharing options...
awpti Posted January 17, 2008 Share Posted January 17, 2008 ...because javascript works really well with IRC. Your best bet is to create a file within the bot's directory and have a timestamp in it Inside the file: timestamp_of_last_request Do a little math and allow the request, say..once every minute, else return an error 'top 10 already requested within the last X minutes'. Quote Link to comment https://forums.phpfreaks.com/topic/86383-solved-halting-php/#findComment-441483 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.