<html>
<head>
<title>Backlinks</title>
<style type="text/css">
input
{
border: 1px solid #000000;
padding: 5px;
font-weight: bold;
}
a:visited
{
color: #0000AA;
}
a:active
{
color: #0000AA;
}
a:hover
{
color: #FF0000;
}
a:link
{
color: #0000AA;
}
textarea
{
border: 1px solid #000000;
padding: 5px;
}
tr.r1
{
text-align: center;
font-family: Verdana;
font-weight: normal;
font-size: 11px;
color: #000000;
background-color: #FFFFEE;
border: 1px #d79900 solid;
border-collapse: collapse;
border-spacing: 0px;
}
table.main
{
text-align: center;
font-family: Verdana;
font-weight: normal;
font-size: 12px;
color: #000000;
background-color: #FFFFEE;
border: 3px #000000 solid;
border-spacing: 1px;
}
tr.r1:hover
{
background-color: #FFCCCC;
font-weight: bold;
}
tr.r2
{
text-align: center;
font-family: Verdana;
font-weight: normal;
font-size: 11px;
color: #000000;
background-color: #EEFFFF;
border: 1px #d79900 solid;
border-collapse: collapse;
border-spacing: 0px;
}
tr.r2:hover
{
background-color: #FFCCCC;
font-weight: bold;
}
tr.r0
{
text-align: center;
font-family: Verdana;
font-weight: normal;
font-size: 13px;
color: #000000;
background-color: #FFFFFF;
border: 1px #d79900 solid;
border-collapse: collapse;
border-spacing: 0px;
}
tr.r3
{
text-align: center;
font-family: Verdana;
font-weight: normal;
font-size: 13px;
color: #000000;
background-color: #FFFFFF;
border: 1px #d79900 solid;
border-spacing: 0px;
}
body
{
background-image:
url('http://www.expiring.org.uk/bkg.jpg');
background-repeat: repeat
}
</style>
</head>
<body>
<?php
if(!isset($_REQUEST['domain'])) //if they haven't input data yet, prompt them
{
?>
<table border="0" width="100%" height="100%">
<tr valign="MIDDLE"><td>
<form method="GET">
<center>
<table class="main">
<tr class="r3"><td><b>Backlink Finder - <a href="http://www.expiring.org.uk">expiring.org.uk</a></b><br />Input Domains to Find BackLinks For</td><tr>
<tr><td><textarea name="domain" cols="40" rows="10">
</textarea></td></tr>
<tr><td><input type="Submit" value="Lookup BackLinks"></td></tr>
</form>
</center>
</td></tr>
</table>
<?
}
else
{
echo "<table border=0 width=\"100%\" height=\"100%\"><tr valign=\"MIDDLE\"><td><center><table border=2>";
echo "<tr class=\"r3\"><td colspan=\"5\"><center><b>Backlink Finder</center></td></tr>";
echo "<tr class=\"r0\"><td><b>Domain</b></td><td><b>DMOZ</b></td><td><b>Yahoo Links</b></td><td><b>Google Links</b></td><td><b>AltaVista Links</b></td><td><b>AllTheWeb Links</b></td></tr>";
$urls=explode("\n",str_replace("www.","",str_replace("http://","", str_replace("\r","",trim($_REQUEST['domain'])))));
for($i=0; $i<sizeof($urls); $i++)
{
echo "<tr class=\"r1\"><td><b>$urls[$i]</b></td><td>" . dmoz_listed($urls[$i]) . "</td><td>" . getYahooLinks($urls[$i])."</td><td>".getGoogleLinks($urls[$i])."</td><td>".getAltavistaLinks($urls[$i])."</td><td>".getAllTheWebLinks($urls[$i])."</td></tr>";
echo "<tr class=\"r2\"><td><b>www.$urls[$i]</b></td><td>" . dmoz_listed($urls[$i]) . "</td><td>" . getYahooLinks("www.".$urls[$i])."</td><td>".getGoogleLinks("www.".$urls[$i])."</td><td>".getAltavistaLinks("www.".$urls[$i])."</td><td>".getAllTheWebLinks("www.".$urls[$i])."</td></tr>";
}
echo "</center></table></td></tr>";
echo "</table>";
}
function getYahooLinks($sURL)
{
$url="https://siteexplorer.search.yahoo.com/advsearch?p=http%3A%2F%2F".urlencode($sURL)."&bwm=i&bwmo=d&bwmf=u";
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "./cookie-jar.txt");
curl_setopt($ch, curlOPT_COOKIEFILE, "./cookie-jar.txt");
// curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 0);
$data=curl_exec($ch);
curl_close($ch);
$spl=explode("</strong> of about <strong>",$data);
$spl2=explode("</strong>",$spl[1]);
$ret=trim($spl2[0]);
if(strlen($ret)==0)
{
return(0);
}
else
{
return($ret);
}
}
function getGoogleLinks($sURL)
{
$url="http://www.google.com/search?num=10&hl=en&safe=off&q=link%3A$sURL&btnG=Search";
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "./cookie-jar.txt");
curl_setopt($ch, curlOPT_COOKIEFILE, "./cookie-jar.txt");
// curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 0);
$data=curl_exec($ch);
curl_close($ch);
$data=str_replace("of about","of",$data);
$spl=explode("</b> of <b>",$data);
$spl2=explode("</b>",$spl[1]);
$ret=trim($spl2[0]);
if(strlen($ret)==0)
{
return(0);
}
else
{
return($ret);
}
}
function getAltavistaLinks($sURL)
{
$url="http://www.altavista.com/web/results?itag=ody&q=link%3A$sURL&kgs=0&kls=0";
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "./cookie-jar.txt");
curl_setopt($ch, curlOPT_COOKIEFILE, "./cookie-jar.txt");
// curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 0);
$data=curl_exec($ch);
curl_close($ch);
$spl=explode("AltaVista found ",$data);
$spl2=explode(" results",$spl[1]);
$ret=trim($spl2[0]);
if(strlen($ret)==0)
{
return(0);
}
else
{
return($ret);
}
}
function getAllTheWebLinks($sURL)
{
$url="http://www.alltheweb.com/search?cat=web&cs=utf-8&q=link%3Ahttp%3A%2F%2F$sURL&_sb_lang=any";
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "./cookie-jar.txt");
curl_setopt($ch, curlOPT_COOKIEFILE, "./cookie-jar.txt");
// curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 0);
$data=curl_exec($ch);
curl_close($ch);
$spl=explode("</span> of <span class=\"ofSoMany\">",$data);
$spl2=explode("</span>",$spl[1]);
$ret=trim($spl2[0]);
if(strlen($ret)==0)
{
return(0);
}
else
{
return($ret);
}
}
//function to check whether an url is listed in DMOZ(ODP), return 1 or 0
function dmoz_listed($sURL)
{
$url="http://search.dmoz.org/cgi-bin/search?search=$sURL";
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "./cookie-jar.txt");
curl_setopt($ch, curlOPT_COOKIEFILE, "./cookie-jar.txt");
// curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 0);
$data=curl_exec($ch);
$pos=strpos($data, 'match');
if ($pos==0) {
return(No);
}
else
{
return(Yes);
}
}
?>
</body>
</html>