title: Php backlink checker on another website
body: <p>I am trying to make a script to check if a webpage has a back link to my page. I have found this script but the problem is that it returns the error message "No back link found" even if there is a backlink. Could someone tell me what is wrong with this script?
  Here is the script I am using:</p>
  
  <pre><code>    require('simple_html_dom.php');
  
  function CheckReciprocal( $targetUrl, $checkLinkUrl, $checkNofollow = true )
  {
      $html = file_get_html($targetUrl);
      if (empty($html))
      {
          //@ Could not load file
          return false;
      }
  
  
      $link = $html-&gt;find('a[href^='.$checkLinkUrl.']',0);
      if (empty($link))
      {
          //@ Link not found
          return false;
      }
  
  
      if ( $checkNofollow &amp;&amp; $link-&gt;hasAttribute('rel') )
      {
          $attr = $link-&gt;getAttribute('rel');
          return (preg_match("/\bnofollow\b/is", $attr) ? false : true);
      }
  
  
      return true;
  } 
  
  $targetUrl = 'http://example.com/test.html';
  
  
  $checkLinkUrl = 'http://mysite.com';
  
  
  if ( CheckReciprocal($test, $checkLinkUrl) )
  {
      echo 'Link found';
  }
  else { echo 'Link not found or marked as nofollow'; }
  </code></pre>
  
  <p>Thank you!</p>