Skip to main content

Link scanner

Code:
<?php header('Content-Type: text/html ; charset=utf-8');?>
<meta http-equiv="Content-Language" content="tr">
<form action="?p=y" method="post"><input value="http://" name="site" type="text" size="34" />&nbsp;&nbsp; 
<input class="buton" type="submit" value="   Yolla   " name="submit"/></form>

<?php

if ($_GET['p']=='y'){

$site = $_POST['site'] ; 

if (eregi('(/$)',$site)){$site = $site;}else{$site = $site . '/';}

$url = file_get_contents($site); 
preg_match_all('/href=[\"\'](.*?)[\"\']/i',$url,$gelen);  
unset($gelen[0]);
 
for ($i=0; $i<count($gelen[1]); $i++){

if (eregi('(^http)|(asp$)|(aspx$)|(htm$)|(php$)|(xml$)|(html$)',$gelen[1][$i])){
if (parse_url($gelen[1][$i],PHP_URL_HOST) == '){
echo $site . parse_url($gelen[1][$i],PHP_URL_PATH).'<br>';
}
elseif (parse_url($gelen[1][$i],PHP_URL_PATH) !== '/' or parse_url($gelen[1][$i],PHP_URL_PATH) !== '){
echo 'http://'.parse_url($gelen[1][$i],PHP_URL_HOST) . parse_url($gelen[1][$i],PHP_URL_PATH).'<br>';
}
} 
}


}
?>

Share this with your friends
Loading...