phibettagamma Posted November 28, 2007 Share Posted November 28, 2007 I'm working on a script, but I'm totally stuck on how to begin @ this. I need a way to know when an hour has passed, and then how to automatically make something happen every hour. Php version 5.2.5 Environment Zend Studio. Thx in advance, Greetz, Phi Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 28, 2007 Share Posted November 28, 2007 a cronjob will do this. I have no idea about them and never used one. But has seen them metioned. Google it and use the idea as a starting point. Quote Link to comment Share on other sites More sharing options...
Ell20 Posted November 28, 2007 Share Posted November 28, 2007 Yeah a cron is the answer. If you have a webhost, go to the control panel and the chances are they will have a option for Cron Jobs. The way it works is that you create the code, just like a PHP file then set the Cron Job to execute this file once an hour. Did my first cron yesterday and its working perfectly Quote Link to comment Share on other sites More sharing options...
phibettagamma Posted November 28, 2007 Author Share Posted November 28, 2007 Yeah a cron is the answer. If you have a webhost, go to the control panel and the chances are they will have a option for Cron Jobs. The way it works is that you create the code, just like a PHP file then set the Cron Job to execute this file once an hour. Did my first cron yesterday and its working perfectly I don't have a host yet, still work in progress and I'm only gonna pay for hosting when my work is done. I work with apache @ home for the moment for testing, is it possible to use a Cron Job then?? Quote Link to comment Share on other sites More sharing options...
eon201 Posted November 28, 2007 Share Posted November 28, 2007 for the time being you could just do a meta refresh for every 216000 seconds and start the page off exactly on the hour??? Just a very quick and easy way to do it. would take you less than 60 secs time to setup! Quote Link to comment Share on other sites More sharing options...
obsidian Posted November 28, 2007 Share Posted November 28, 2007 Yeah a cron is the answer. If you have a webhost, go to the control panel and the chances are they will have a option for Cron Jobs. The way it works is that you create the code, just like a PHP file then set the Cron Job to execute this file once an hour. Did my first cron yesterday and its working perfectly I don't have a host yet, still work in progress and I'm only gonna pay for hosting when my work is done. I work with apache @ home for the moment for testing, is it possible to use a Cron Job then?? Is your local install of apache on linux or windows? If it is on Windows, then you'll need to set up a scheduled task (here is a nice tutorial that will get you going for that). If it's on Linux, let us know, and we can walk you through setting up a crontab there as well. Quote Link to comment Share on other sites More sharing options...
phibettagamma Posted November 28, 2007 Author Share Posted November 28, 2007 it's under windows, i'll look into the tut tomorrow thx for the help guys Greetz, Phi Quote Link to comment 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.