Status
Not open for further replies.

1LinkDL

Member
9
2011
0
0
can about one help me i have found linkback and whitelist script here
Code:
http://www.wjunction.com/showpost.php?p=765898&postcount=22

but i can not get it to check more then one domain.
i have been trying to check for a linkback to any of my websites
E.G (site1.com, site2.com, site3.com, site4.com)

PHP:
$ururl = "site1.com";
$ururl = "site2.com";
$ururl = "site3.com";
$ururl = "site4.com";
i have already tried adding domains like this but no luck. :'(

here is the code i found.
PHP:
<?php

function linkback($link, $ururl)  
{  
    $ch = curl_init($link);  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
    curl_setopt($ch, CURLOPT_HEADER, 0);  
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);  
    curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.80 (Windows NT 5.1; U; en) Presto/2.7.62 Version/11.01');  
    $page = curl_exec($ch);  
    curl_close($ch); 
    if (stripos($page,$ururl)===false) 
      return false; 
    else 
      return true;
}

if(isset($_POST['siteurl']) && !empty($_POST['siteurl']))
{
//jomasaco's code
$siteurl = $_POST['siteurl']; //need be in http 
$surl = $siteurl;
if (!preg_match('#^http://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?$#i', $surl))  //not sure if are the best way
die('Invalid Domain shold be in format http://domain.tld');
$surl = parse_url(trim($surl)); //remove spaces split the url 
$surl= str_ireplace("www.","",$surl['host']); //get host
$ipAddress = gethostbyname($surl);
if($ipAddress === $surl)
{
    die('Error: Invalid Domain.');
}
//jomasaco's code
$ururl = "extremeddl.net";

$connect = mysql_connect ("localhost", "root", "jorge") or die ('Connection Fail!');

mysql_select_db("wcddl", $connect) or die ('lol');

$x = mysql_num_rows(mysql_query("select url from wcddl_whitelist where url = '".mysql_real_escape_string($surl)."'"));
if ($x!=0)
{
  die ("Already Whitelisted");
}
$x = mysql_num_rows(mysql_query("select url from wcddl_blacklist where url = '".mysql_real_escape_string($surl)."'"));
if ($x!=0)
{
  die ("Your Site are Blacklisted.<br /> Contact the admin.");
}
elseif ($x==0)
{
  //curl_part to retrieve content from the said sitename & chk for link back 
  if(linkback($siteurl,$ururl)==true)
  {
    $add = mysql_query("INSERT INTO wcddl_whitelist (url) VALUES ('".mysql_real_escape_string($surl)."')");
    echo "Whitelisted!";
  }
  else
  {
    die('No Link Back');
  }
}
}
else
{
    echo'
    <form action="'.$_SERVER['PHP_SELF'].'" method="post">
    <input type="text" size="32" class="text" value="http://" name="siteurl" />
   <input class="button" type="submit" name="submit"/>
    ';
}

/* entire credits to humour
http://www.wjunction.com/member.php?u=5806 */
?>

if anybody could help me out or point me in right way to making this work <3<3 please it has been driving me nuts :'(

__________________
Added after 7 Hours 54 minutes:

anybody got any help ??
 
Last edited:
Status
Not open for further replies.
Back
Top