Results 1 to 2 of 2

Thread: Help me with this code

Hybrid View

  1. #1

    Help me with this code

    Hi ,

    I actually coded a php to check for backlink on all the sites listed on my Proxy List Site .

    I even used usleep to get over the time limit set by server people , but still the script would stop working after few checks

    Here is the link you can see :

    Backlink Checker

    The code for same is :

    PHP Code:

    ""// Set this to your domain

    $list file_get_contents("new.txt");
    $urls explode ("\n"$list);

    "<B>Checking back links to $mydomain....</B><P><FONT SIZE=-1>";

        foreach (
    $urls as $url) {
    date('h:i:s') . "<br />";

    //sleep for 10 seconds

    //start again
    echo date('h:i:s');

        if (
    strlen ($url)) {
    $url "<B><FONT COLOR=";
        if (
    strpos (file_get_contents($url), $mydomain) != FALSE) {
    "GREEN> Found";
        } else {
    "RED> Missing";

    New.txt is written with the help of another php file which connects to DB and writes the details to new.txt

    Please look into code and help me & also tell me how to add to avoid for a site which is down so it doesnt stop my script?


  2. #2
    Yeah I had this trouble, what happened was sometimes it would hit a dead link and wouldn't resolve, and it would make the script die.
    You should do this will cURL and set the timeout like 10 seconds
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,10);
    curl_setopt($ch, CURLOPT_TIMEOUT,10);

    instead of strpos use preg_match with a regural expression,

    if(!preg_match('#<a[^>]+href\s*=\s*(["\\\']?)http://(?:www\.)?example\.com#i', $website_html)){
    echo "This is bad!";
    Submit new proxies -

Similar Threads

  1. What is a Bar Code Reader ?
    By Digital in forum Tech-Talk
    Replies: 4
    Last Post: 8 November, 2012, 19:34 PM
  2. Do you code your designs?
    By Farrhad A in forum Web Design
    Replies: 22
    Last Post: 30 November, 2011, 10:59 AM
  3. where i should paste this code?
    By garfish in forum Programming
    Replies: 4
    Last Post: 9 April, 2010, 07:39 AM
  4. WP code change help Please.
    By Sami4u in forum Wordpress
    Replies: 13
    Last Post: 3 April, 2010, 18:27 PM
  5. Help figure this code out???
    By in forum Web Proxies
    Replies: 0
    Last Post: 17 December, 2009, 19:27 PM

Tags for this Thread


Posting Permissions

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