Jump to content


Photo

Auto-executing php scripts


  • Please log in to reply
2 replies to this topic

#1 flagman5

flagman5
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 17 April 2006 - 03:37 AM

Hi All

Sorry if this is a commonly addressed question

but is there way to create php script/function that will automatically edit a TXT file in the same directory at a specified time?

my use for this is that I have a webpage where it shows a bunch of threads (kind of like a bbs) and then I want to be able to insert a big horizontal break after each day, so it nicely separates each days postings

is it possible to coordinate with the server clock and at the beginning of everyday at 00:00:01 it will automatically edit that webpage and pop in the daybreak line

thanks!

#2 ypirc

ypirc
  • Members
  • PipPipPip
  • Advanced Member
  • 54 posts

Posted 17 April 2006 - 03:54 AM

I'm assuming the server is *nix based...look into crontab. If it's windows based, windows as the "at" command.

#3 DrDre

DrDre
  • Members
  • PipPipPip
  • Advanced Member
  • 35 posts

Posted 17 April 2006 - 10:34 AM

Unless you leave your browser open 24/7 refreshing every second, theres no way to make it on a php level schedule things to happen.

So yeah you got to use cron jobs or at as said above.

php works as its called, it doesnt run 24/7. So unless its being run at the time being needed it doesnt know to run

[a href="http://forums.fanetworks.net" target="_blank"][/a]
» faNetworks Webmaster. [[a href="http://fanetworks.net" target="_blank"]fanetworks.net[/a]]
» faSoftware Developer [[a href="http://software.fanetworks.net" target="_blank"]software.fanetworks.net[/a]]
» faForums - php Resource + more [[a href="http://forums.fanetworks.net" target="_blank"]forums.fanetworks.net[/a]]
» Experienced php Coder - Ill help anyone I can if I have time ;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users