задавате линка във формат http://jooorooo.data.bg
Код:
<form action="" method="GET">
<input type="text" name="url">
<input type="submit" value="asdasd">
</form>
<?
if($_GET['url'])
{
$url=$_GET['url'];
$url = str_replace("http://", "", $url);
$text= @file_get_contents("http://".$url);
$preg =
"/a[\s]+[^>]*?href[\s]?=[\s\"\']+(.*?)[\"\']+.*?>"
."([^<]+|.*?)?<\/a>/";
preg_match_all(trim($preg),$text, $out, PREG_PATTERN_ORDER);
$keys = $out[1];
$values = $out[2];
foreach ($keys as $keyss)
{
$tipfail=end(explode(".", $keyss));
if(($tipfail != "rar") && ($tipfail != "zip") && ($tipfail != "mp3") && ($tipfail != "iso") && ($tipfail != "jpg") && ($tipfail != "tr") && ($tipfail != "mov") && ($tipfail != "jpg") && ($tipfail != "wmv") && ($tipfail != "ace") && ($tipfail != "ico") && ($tipfail != "jpeg") && ($tipfail != "avi") && ($tipfail != "3gp") && ($tipfail != "mp4") && ($tipfail != "cue") && ($tipfail != "srt") && ($tipfail != "txt") && ($tipfail != "bin") && ($tipfail != "gif") && ($tipfail != "sub") && ($tipfail != "bmp") && ($tipfail != "mpg") && ($tipfail != "bat") && ($tipfail != "img") && ($tipfail != "wma") && ($tipfail != "ac3") && ($tipfail != "wav") && ($tipfail != "tar") && ($tipfail != "mpeg") && ($tipfail != "png") && ($tipfail != "com") && ($tipfail != "exe") && ($tipfail != "tiff") && ($tipfail != "pdf") && ($tipfail != "sql") && ($tipfail != "html") && ($tipfail != "JPG") && ($tipfail != "doc") && ($tipfail != "htm") && ($tipfail != "xls") && ($tipfail != "msi"))
{
$rest = substr($keyss, -1);
if($rest=="/")
{
$fdsfsd1.= "<a href=\"?url=".$keyss."\">".urldecode($keyss)."</a><br>";
}
else
{
}
}else{
$fdsfsd2.= "<a href=\"".$keyss."\" target=\"_new\">".urldecode($keyss)."</a><br>";
}
}
echo $fdsfsd1."<br><br>".$fdsfsd2;
}
?>