Scummy12 Posted November 25, 2010 Share Posted November 25, 2010 Hello, I need help in making my script loop indefinitely. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/219821-make-a-script-repeat/ Share on other sites More sharing options...
mort Posted November 25, 2010 Share Posted November 25, 2010 pretty vague, depends what the script should do. obviously scripts that run forever are bad due to execution and memory limits sounds like you want to run a script that will run a batch, and then set it to repeat using CRON jobs Quote Link to comment https://forums.phpfreaks.com/topic/219821-make-a-script-repeat/#findComment-1139522 Share on other sites More sharing options...
robert_gsfame Posted November 25, 2010 Share Posted November 25, 2010 dont get what you mean..are you going to send some bulk email to your enemy, arent you? Quote Link to comment https://forums.phpfreaks.com/topic/219821-make-a-script-repeat/#findComment-1139524 Share on other sites More sharing options...
laffin Posted November 25, 2010 Share Posted November 25, 2010 myloop.php <?php echo "Hello World!"; ?> main.php function mainloop() { require_once('myloop.php'); } while(1) { mainloop(); } about only problem with this setup, is that your loop code loses access to the variables such as $_GET/$_POST etc etc etc Quote Link to comment https://forums.phpfreaks.com/topic/219821-make-a-script-repeat/#findComment-1139528 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.