SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Checking if other sites still have your link on theirs (Reciprocal linking)

    Hi,

    Is there any better and quicker way of searching for my link on other sites pages where I have exchanged links. I have done the below script and it is very slow. It takes about 1 minute just to do 20 links and I have over 4,000.

    It also brings up errors like permissions denied for x site, connection died out for y site, etc.

    Here's what I have so far.

    PHP Code:
    $sqled mysql_query("SELECT ided, reciprocal FROM affil ORDER BY ided ASC LIMIT 0, 20");
    while(
    $rows mysql_fetch_array($sqled)){

    if(!empty(
    $rows[reciprocal])){
    $extsite "$rows[reciprocal]";

    $extsitedo file_get_contents("$extsite");
    $checklinks "http://www.mydomainname.com";

    if(
    strpos($extsitedo$checklinks)){
    echo 
    "SITE FOUND<br />";
    }else{
    echo 
    "SITE NOT FOUND<br />
    }}} 

  2. #2
    SitePoint Zealot mwasif's Avatar
    Join Date
    Apr 2007
    Location
    Pakistan
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use cURL instead of file_get_contents(). It is possible that some sites do not allow unknown user agents. In cURL you can specify agent.

    You can find examples how to use cURL at http://www.php.net/curl.

    This will at least solve your access denied problem.

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I will take a look into this function.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •