|
Posted by Krustov on 12/17/48 11:53
<comp.lang.php>
<bobmct>
<Fri, 21 Jul 2006 11:29:16 -0400>
<un6wg.8$5v3.696@news.ntplx.net>
> > Is there is way to run a php file perodically everyday on scheduled
> > time in such a way that there is no human interaction and it
> > performence the written task.
>
> I do this every night with several php scripts that DO things in an
> unattended mode.
>
> I make sure that I have the proper shebang (#!/usr/bin/php) as the first
> statement of my script, then I create a cron job to run at the specified
> time to execute the appropriate php script(s).
>
> Works like a charm.
>
www.emailuser.co.uk/popular.php
Not a cron job - but the first person to look at the webpage after
midnight will fire up the 'process loops' and then save the results so
they can just be read in anytime afterwards .
$junko=date("l dS of F Y h:i:s A"); $coke=substr($junko,0,5);
$filename="demo/day_popular.php";
$fp=fopen($filename,"r"); $qaz=fgets($fp); $pepsi=trim($qaz); fclose
($fp);
if ($coke<>$pepsi)
{
BLAH BLAH RUN THE LOOPS - AND SAVE THE RESULTS
$filename="demo/day_popular.php";
$fp=fopen($filename,"w"); fwrite ($fp,$coke); fwrite ($fp,"\n"); fclose
($fp);
}
--
Encrypted email address
www.emailuser.co.uk/?name=KRUSTOV
Make a shorter url
www.vhit.co.uk
Navigation:
[Reply to this message]
|