Forum Moderators: coopster
here is the code I propose to use:
<?PHP
sleep(29);
echo "Done\n";
?>
<?PHP
function sendmail($to,$from,$subject,$body){
$to="$to";
$headers.= "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; ";
$headers.= "charset=iso-8859-1\r\n";
$headers.= "From: $from";
$subject = "$subject";
$body = "<HTML><BODY>
$body
</BODY></HTML>
";
mail($to,$subject,$body,$headers);
}
?>
Can you guys see any problems with just using the sleep function like this? would there be a better way to do it?
Also in anyones experience, would there be an issue of time outs with such a large number of seconds PHP is sleeping for, or can it go higher?
Thank you very much for any help or advice ^_^
<?PHP
sleep(29);
echo "Done\n";
function sendmail($to,$from,$subject,$body){
$to="$to";
$headers.= "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; ";
$headers.= "charset=iso-8859-1\r\n";
$headers.= "From: $from";
$subject = "$subject";
$body = "<HTML><BODY>
$body
</BODY></HTML>
";
mail($to,$subject,$body,$headers);
}
?>
did end up working...
My question now is, how long is too long to make PHP sleep?
i.e. how long before I get timeouts and other such errors etc?
Once again, any help or advice is greatly appreciated ^_^
I would suggest you to do a test before you use sleep() in your code.
Open firefox and open two tabs.
Open a youtube video in one page, while it is streaming, in the second tab run your sleep() script with a one minute interval.
ctrl+alt+delete and go to memory and cpu usage window
now check your system health as well as streaming video status and let me know if you feel anything strange with it.