Hi,
I have the following script which I'm using to verify that websites
exist. However in either FF or IE it only runs for about 60 seconds.
I've changed what ini settings I think affect it, but to no avail. Can
you tell me how to make it run for longer. I could have quite a few
hundred sites and I simply want to make sure they return OK.
The code will work as is but you'll see it probably won't do quite a
long list. (stops at about 10).
Thanks
A
<?php
ini_set('max_ex ecution_time',9 99);
ini_set('max_in put_time',999);
if (!(isset($_POST['sites']))){
print "<form method=\"post\" action=\"test2. php\"><textarea name=
\"sites\" rows=25 cols=25></textarea><input type=\"submit\" ></form>";
} else {
$sites = split("\r\n",$_ POST['sites']);
foreach ($sites as $path){
$http_response_ header = array(); // clear arrays in case previous
data still held
$file = array();
$file = @file_get_conte nts("http://$path");
if (!(is_numeric(s trpos($http_res ponse_header[0],"OK")))){ //
Is the website NOT ok
if (is_numeric(str pos($http_respo nse_header[0],"30"))){ //
Has it been redirected?
foreach ($http_response _header as $k=>$value){
$value = str_replace("Co ntent-Location","",$v alue); //
Strip out the Content tags which confuse issues
if (is_numeric(str pos($value,"Loc ation"))){ //
If this one carries the location - use it
$value = str_replace("Lo cation: ","",$value );
$http_response_ header = array();
$file2 = @file_get_conte nts($value); // Connect
to the forwarded site just to check
if (!(is_numeric(s trpos($http_res ponse_header[0],"OK"))))
{
print "$path <b>IS NOW</b$value<br>";
} else {
print "$value redirected but is DEAD<br>";
}
}
}
} else {
print "$path is not live<br>";
}
} else {
print "$path is ok<br>";
}
}
}
?>
I have the following script which I'm using to verify that websites
exist. However in either FF or IE it only runs for about 60 seconds.
I've changed what ini settings I think affect it, but to no avail. Can
you tell me how to make it run for longer. I could have quite a few
hundred sites and I simply want to make sure they return OK.
The code will work as is but you'll see it probably won't do quite a
long list. (stops at about 10).
Thanks
A
<?php
ini_set('max_ex ecution_time',9 99);
ini_set('max_in put_time',999);
if (!(isset($_POST['sites']))){
print "<form method=\"post\" action=\"test2. php\"><textarea name=
\"sites\" rows=25 cols=25></textarea><input type=\"submit\" ></form>";
} else {
$sites = split("\r\n",$_ POST['sites']);
foreach ($sites as $path){
$http_response_ header = array(); // clear arrays in case previous
data still held
$file = array();
$file = @file_get_conte nts("http://$path");
if (!(is_numeric(s trpos($http_res ponse_header[0],"OK")))){ //
Is the website NOT ok
if (is_numeric(str pos($http_respo nse_header[0],"30"))){ //
Has it been redirected?
foreach ($http_response _header as $k=>$value){
$value = str_replace("Co ntent-Location","",$v alue); //
Strip out the Content tags which confuse issues
if (is_numeric(str pos($value,"Loc ation"))){ //
If this one carries the location - use it
$value = str_replace("Lo cation: ","",$value );
$http_response_ header = array();
$file2 = @file_get_conte nts($value); // Connect
to the forwarded site just to check
if (!(is_numeric(s trpos($http_res ponse_header[0],"OK"))))
{
print "$path <b>IS NOW</b$value<br>";
} else {
print "$value redirected but is DEAD<br>";
}
}
}
} else {
print "$path is not live<br>";
}
} else {
print "$path is ok<br>";
}
}
}
?>
Comment