hi guys
i made this script for my web dir to validate the links
so i got over 3000 links and this script i made is to slowley for this number
any ideas ?
<?php
include("config.php");
include("../themes/style.php");
include("paging_class.php");
mysql_connect($host,$dbuser,$dbpass);
mysql_select_db($dbname2);
if ($active=="urlcheck"&&"$count<=0") {
$num=40;
if ($count>=$num) {
echo "done";
}
} else {
if ($count<$num) {
$res=mysql_db_query($dbname2,"SELECT * FROM links order by lid ASC LIMIT $count,10");
while ($row = mysql_fetch_array ($res)) {
$proxy = "192.10.26.5";
$port = 8080;
$fp = fsockopen($proxy, $port);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET $row[url] HTTP/1.1\r\n";
$out .= "Host: $proxy\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
$my=fgets($fp, 22);
if (!ereg("200 OK", $my)) {
$res0 = mysql_db_query($dbname2,"SELECT * FROM links where url='$row[url]'");
while ($row = mysql_fetch_array ($res0)) {
echo "<font face=verdana size=3px color=#0000CC>• </font>$row[title] - <i> Not Working</i><br>";
mysql_db_query($dbname2,"INSERT INTO broken (lid,cid,sid,title,url,description,date,email,hits) VALUES ('$row[lid]','$row[cid]','$row[sid]','$row[title]','$row[url]','$row[description]','$row[date]','$row[email]','$row[hits]')");
}
fclose($fp);
$count = $count + 10;
echo "<html><head><META HTTP-EQUIV=Refresh CONTENT=1;URL=$PHP_SELF?active=urlcheck&count=$count></head></html>";
}
}
}
}
}
} else {
}
?>
thanks