Dragen Posted June 18, 2007 Share Posted June 18, 2007 Okay.. I'm trying to write a script which gets a random number every day, or 24 hours. I'm sure that the only way of doing this is using cron jobs, but I've checked with my host and they don't allow cron jobs :-\ Is there any other possible way of getting a script to activate every 24 hours? Quote Link to comment https://forums.phpfreaks.com/topic/56039-carry-out-function-every-24-hours-without-cron-jobs/ Share on other sites More sharing options...
aniesh82 Posted June 18, 2007 Share Posted June 18, 2007 I am not sure but please try by using javascript function setInterval() Waits for 24 hour and call the same page. Quote Link to comment https://forums.phpfreaks.com/topic/56039-carry-out-function-every-24-hours-without-cron-jobs/#findComment-276749 Share on other sites More sharing options...
Dragen Posted June 18, 2007 Author Share Posted June 18, 2007 Thanks for the reply. I'm trying to stay away from javascript if possible as it means many people wont be able to access certain features of my site, so I really need it to be server side script, not client side. Quote Link to comment https://forums.phpfreaks.com/topic/56039-carry-out-function-every-24-hours-without-cron-jobs/#findComment-276811 Share on other sites More sharing options...
trq Posted June 18, 2007 Share Posted June 18, 2007 Javascript isn't going to help in any case. I'm afraid your only real option is cron. If your current server does not support it, either find one that does or get yourself a free shell account somewhere, from that shell account you can request scripts on your site via cron. Quote Link to comment https://forums.phpfreaks.com/topic/56039-carry-out-function-every-24-hours-without-cron-jobs/#findComment-276820 Share on other sites More sharing options...
ToonMariner Posted June 18, 2007 Share Posted June 18, 2007 You could add a snippet that runs and checks a value in the database against the date it was last edited. However this would entail an exra query on each request of the page you placed that query in - so as thorpe says a cron is really the only answer. Quote Link to comment https://forums.phpfreaks.com/topic/56039-carry-out-function-every-24-hours-without-cron-jobs/#findComment-276825 Share on other sites More sharing options...
Dragen Posted June 18, 2007 Author Share Posted June 18, 2007 Javascript isn't going to help in any case. I'm afraid your only real option is cron. If your current server does not support it, either find one that does or get yourself a free shell account somewhere, from that shell account you can request scripts on your site via cron. How do I go about getting a shell account? what is a shell account? Quote Link to comment https://forums.phpfreaks.com/topic/56039-carry-out-function-every-24-hours-without-cron-jobs/#findComment-276832 Share on other sites More sharing options...
per1os Posted June 18, 2007 Share Posted June 18, 2007 http://www.google.com/search?hl=en&q=free+cron+jobs&btnG=Google+Search You can get free hosting to allow cron jobs. Which you should be able to make them open up a link on your current webserver which runs the script. Quote Link to comment https://forums.phpfreaks.com/topic/56039-carry-out-function-every-24-hours-without-cron-jobs/#findComment-276835 Share on other sites More sharing options...
Dragen Posted June 18, 2007 Author Share Posted June 18, 2007 Thanks. I've just signed up for an account, but am waiting for it to be validated before I can use it... Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/56039-carry-out-function-every-24-hours-without-cron-jobs/#findComment-276853 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.