MrNase
Mon 31st May '04, 10:12am
Hey,
Here's what i want: A very simple loop that checks every 5 minutes if a script is on the server. Why that? Iam waiting so badly for my new server and i don't want to check every 5 minutes on my own ;)
Here's what i already got:
function checkit() {
$dummy = @fopen("http://www.validhtml.com/phpinfo.php","r");
if(!$dummy)
{
$ergebnis = "no";
}
else
{
$ergebnis = "yes";
}
return $ergebnis;
}
for ($i = 1; $i <= 10; $i++) {
echo checkit();
sleep('1');
$i++;
}
But that doesn't work as expected...
I want the script to check every 5 minutes and echo the status everytime the scripts checks for the file.
By now, the script checks for the file, waits a minute and checks it again and so on but it doesn't echo the status... The status is echoed when the script ran successfully (after 10 seconds -> 10 checks).
I want to have
status (5 minutes break)
status (5 minutes break)
[...]
and not
(5 minutes break) statusstatusstatusstatusstatusstatusstatusstatusst atusstatus
Hope you understood what i want ;)
Here's what i want: A very simple loop that checks every 5 minutes if a script is on the server. Why that? Iam waiting so badly for my new server and i don't want to check every 5 minutes on my own ;)
Here's what i already got:
function checkit() {
$dummy = @fopen("http://www.validhtml.com/phpinfo.php","r");
if(!$dummy)
{
$ergebnis = "no";
}
else
{
$ergebnis = "yes";
}
return $ergebnis;
}
for ($i = 1; $i <= 10; $i++) {
echo checkit();
sleep('1');
$i++;
}
But that doesn't work as expected...
I want the script to check every 5 minutes and echo the status everytime the scripts checks for the file.
By now, the script checks for the file, waits a minute and checks it again and so on but it doesn't echo the status... The status is echoed when the script ran successfully (after 10 seconds -> 10 checks).
I want to have
status (5 minutes break)
status (5 minutes break)
[...]
and not
(5 minutes break) statusstatusstatusstatusstatusstatusstatusstatusst atusstatus
Hope you understood what i want ;)