I'm looking for a way to make a site update itself every $i minutes. Like a script that would check the number of threads at some forum but only every 60 minutes, not constantly, and then post it. Without the need to do it manually. I'm not looking for a finished script, just for a way to do it. Anyone
Cron jobs. 1- Create your php script that does what you want without having to care about the $i minutes issue. 2- From cpanel or shell, add a cron job for this file..
Just wondering though mate? what do you want this code for? If its like a forum, like you say, people go into posts, click back, and if its a forum software, like vb or phpbb, it will update it then. So unless someone is going to sit for an hour, and not do anything, you wouldnt need it. If its somthing like ebay, and its a count down -- people keep hitting that F5 key every second! to make sure their page is up-to-date. The only real reason you'd need somthing that auto updates is like an rpg, but that would use a server, and run real time. Not been funny mate, i'd just like to know what your up to Cheers.
A directory type of site which posts the position of the site in my directory. The regular thing actually, nothing special
I did something like this once. I wanted to display new rows of databse based of the time. Say we start from 1 Jan 2006 and now is 30 Jan 2006 and $i is 24 hours. So when the page loads end users see 30 rows of the database. If it is 60 days passed the start day they see 60 rows and so on. To do something like these you should study time and date functions in PHP. .
Yep, that is pretty much the same thing I was planning to do (and probably will), but this does a check every time someone displays the page. That is something I wanted to avoid. Thanks for your replies guys, the cron thing won't do cause my host is ...hmmm... different Talked to him and well, he's not really comfortable with it. He's a good buddy of mine so well, it's his host.
The easy way would be to check the values everytime the image showing the position is being loaded. Pretty straight forward. If I have dropped the idea? Well, I was just thinking about it, thinking how I'd do it