RE: [PHP] Program Looping ?

2002-03-29 Thread Hunter, Ray

You need to also make sure that you change the script execution time allowed
in the php.ini file to 5 minutes or more or else you will get a time out
error.



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


 -Original Message-
 From: Jason Caldwell [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, March 28, 2002 11:56 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Program Looping ?
 
 
 I've written a script that checks my email.  However, when I 
 run the script (from the command line) -- I want it to loop 
 with a 5 minute delay and the ability to stop the program 
 anytime by pressing a key on the keyboard (say) the ~ key.
 
 Anyone know how to do this?
 
 ?
 
 function check_mail()
 {
 // my email code is here
 }
 
 check_mail();
 
 ?
 
 thanks.
 jason
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



RE: [PHP] Program Looping ?

2002-03-28 Thread Demitrious S. Kelly

Well you'd have to work with inputs, etc... for the key... but the look
isn't hard

$loop=1;
$sleep=300;
while ( $loop == 1 ) {
code();
sleep($sleep);
if ( %%keypresscode%% ) {
$loop = 0;
}
}

I'd probably just touch a file somewhere when I want it to stop.. and
make it if (is_file($file)) { $loop=0; }

That's my opinion

-Original Message-
From: Jason Caldwell [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, March 28, 2002 10:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Program Looping ?

I've written a script that checks my email.  However, when I run the
script
(from the command line) -- I want it to loop with a 5 minute delay and
the
ability to stop the program anytime by pressing a key on the keyboard
(say)
the ~ key.

Anyone know how to do this?

?

function check_mail()
{
// my email code is here
}

check_mail();

?

thanks.
jason



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php