<?php
$startingpoint = "<br>1.";
$endingpoint = "</a><br><hr>";
preg_match("/^(https?:\/\/)?([^\/]*)(.*)/i", "http://crackspider.net/search.shtml?q=$q", $matches);
$theDomain = "http://" . $matches[2];
$page = $matches[3];
$fd = fopen($theDomain.$page, "r");
$value = "";
while(!feof($fd)){
$value .= fread($fd, 4096);
}
fclose($fd);
$start= strpos($value, "$startingpoint");
$finish= strpos($value, "$endingpoint");
$length= $finish-$start;
$value=substr($value, $start, $length);
$value = eregi_replace( "<b>CrackSpider</b> does not host any files ! This site merely indexes other sites content", "", $value );
$value = eregi_replace( "<IMG alt=[^>]*>", "", $value );
$value = eregi_replace( "<IMG alt=[^>]*>", "", $value );
$value = eregi_replace( "<class[^>]*>", "", $value );
$value = eregi_replace( "<table[^>]*>", "", $value );
$value = eregi_replace( "<tr[^>]*>", "", $value );
$value = eregi_replace( "<td[^>]*>", "", $value );
$value = str_replace( "</font>", "", $value );
$value = str_replace( "</table>", "", $value );
$value = str_replace( "</tr>", "", $value );
$value = str_replace( "</td>", "", $value );
$value = str_replace( "<center>", "", $value );
$value = str_replace( "</center>", "", $value );
$value = str_replace( "<b>", "", $value );
$value = str_replace( "</b>", "", $value );
$value = eregi_replace( "href=", "target=\"_blank\" href=", $value );
$value = eregi_replace( "href=\"", "target=\"_blank\" href=\"", $value );
$FinalOutput = preg_replace("/(href=\"?)(\/[^\"\/]+)/", "\\1" . $theDomain . "\\2", $value);
echo $FinalOutput;
flush ();
?>