Very Small PHP Issue

Discussion in 'Programming' started by Zo0mer, Apr 24, 2008.

  1. #1
    Hi, I have a very small issue, I have downloaded

    http://freeajaxscripts.net/index.ph...osmsg=Your+rating+has+been+successfully+added

    and I have uploaded it to my server, I run the script with ebay.com I get the following error.

    Warning: file_get_contents(http://www.google.com/search?client=navclient-auto&ch=62147383943&features=Rank&q=info:ebay.com) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/sites/google-page-rank.biz/public_html/php/rank.class.php on line 29


    The Alexa Rank and the Average Back Link Works, but the google does.

    I will offer a couple of $ if you are able to fix it. Thank You
     
    Zo0mer, Apr 24, 2008 IP
  2. AdnanAhsan

    AdnanAhsan Well-Known Member

    Messages:
    601
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    please add me then we can discuss it .. thanks
     
    AdnanAhsan, Apr 24, 2008 IP
  3. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    As Seller:
    100% - 0
    As Buyer:
    100% - 1
    #3
    hi

    Try this

    <?php
    function loadXFile($location) {
    $fp = fsockopen($location, 80, $errno, $errstr, 30);
    if (!$fp) {
    $result = "$errstr ($errno)<br />\n";
    } else {
    $out = "GET / HTTP/1.1\r\n";
    $out .= "Host: ".$location."\r\n";
    $out .= "Connection: Close\r\n\r\n";

    fwrite($fp, $out);
    while (!feof($fp)) {
    $result .= fgets($fp, 128);
    }
    fclose($fp);
    }
    return $result;
    }

    print loadXFile("http://www.google.com/search?client=navclient-auto&ch=62147383943&features=Rank&q=info:ebay.com")
    ?>

    Regards

    Alex
     
    kmap, Apr 24, 2008 IP