Re: Script not working correctly
| From: | Tomator | Date: | Tue, 18 Jun 2002 07:37:44 +0000 |
| Subject: | Re: Script not working correctly | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-14260@lists.php.net to get a copy of this message | ||
> I created this script to ping a host and if a response is not received
then
> insert into a second table and ping it after x amount of minutes. The
script
> seems to work fine until it starts to ping the hosts in the second table
> then it goes to page cant be displayed. I need to script to entire script
to
> run constantly but with a delay before it runs. Please help.
Your script IS working correctly but maybe not as you want. PHP is not
designed to run 'constatnly running" scripts. If you try, you will geat an
timeout (after 30 seconds).
If you want to repeat pinging any server after x seconds, use REFRESH. In
that way, your script will generate HTML page (with text "ping problems,
waiting...") and refresh it running script again (and again and.... until
you close browser window or go to another page). Try this:
<html>
<head>
<meta http-equiv="refresh" content="x;URL=http://want.to.ping.it.again">
</head>
...
</html>
where "x" in third line is amount of seconds to wait