SitePoint Sponsor

User Tag List

Results 1 to 24 of 24
  1. #1
    SitePoint Zealot php.net's Avatar
    Join Date
    Oct 2003
    Location
    php.net
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Google pagerank cheker by PHP

    Hello,

    Any one this script working with him.

    pagerank.php
    PHP Code:
    <?php 
    define
    ('GOOGLE_MAGIC'0xE6359A60); 
    class 
    pageRank{
    var 
    $pr
     function 
    zeroFill($a$b){ 
     
    $z hexdec(80000000);
      if (
    $z $a){ 
       
    $a = ($a>>1); 
       
    $a &= (~$z); 
       
    $a |= 0x40000000
       
    $a = ($a>>($b-1)); 
      }else{ 
       
    $a = ($a>>$b); 
      } 
     return 
    $a
     } 
     
     function 
    mix($a,$b,$c) { 
       
    $a -= $b$a -= $c$a ^= ($this->zeroFill($c,13));
       
    $b -= $c$b -= $a$b ^= ($a<<8);
       
    $c -= $a$c -= $b$c ^= ($this->zeroFill($b,13));
       
    $a -= $b$a -= $c$a ^= ($this->zeroFill($c,12));
       
    $b -= $c$b -= $a$b ^= ($a<<16);
       
    $c -= $a$c -= $b$c ^= ($this->zeroFill($b,5));
       
    $a -= $b$a -= $c$a ^= ($this->zeroFill($c,3));
       
    $b -= $c$b -= $a$b ^= ($a<<10);
       
    $c -= $a$c -= $b$c ^= ($this->zeroFill($b,15));
       return array(
    $a,$b,$c); 
     } 
     
     function 
    GoogleCH($url$length=null$init=GOOGLE_MAGIC) { 
      if(
    is_null($length)) { 
       
    $length sizeof($url); 
      } 
      
    $a $b 0x9E3779B9;
      
    $c $init;
      
    $k 0;
      
    $len $length;
      while(
    $len >= 12) { 
       
    $a += ($url[$k+0] +($url[$k+1]<<8) +($url[$k+2]<<16) +($url[$k+3]<<24));
       
    $b += ($url[$k+4] +($url[$k+5]<<8) +($url[$k+6]<<16) +($url[$k+7]<<24));
       
    $c += ($url[$k+8] +($url[$k+9]<<8) +($url[$k+10]<<16)+($url[$k+11]<<24));
       
    $mix $this->mix($a,$b,$c);
       
    $a $mix[0]; $b $mix[1]; $c $mix[2];
       
    $k += 12;
       
    $len -= 12
      }
      
    $c += $length;
      switch(
    $len){ 
       case 
    11$c+=($url[$k+10]<<24);
       case 
    10$c+=($url[$k+9]<<16);
       case 
    $c+=($url[$k+8]<<8);
       
    /* the first byte of c is reserved for the length */
       
    case $b+=($url[$k+7]<<24);
       case 
    $b+=($url[$k+6]<<16);
       case 
    $b+=($url[$k+5]<<8);
       case 
    $b+=($url[$k+4]);
       case 
    $a+=($url[$k+3]<<24);
       case 
    $a+=($url[$k+2]<<16);
       case 
    $a+=($url[$k+1]<<8);
       case 
    $a+=($url[$k+0]); 
      } 
      
    $mix $this->mix($a,$b,$c); 
     
    /* report the result */ 
     
    return $mix[2]; 
     } 
     
     
    //converts a string into an array of integers containing the numeric value of the char 
     
     
    function strord($string) { 
      for(
    $i=0;$i<strlen($string);$i++) { 
       
    $result[$i] = ord($string{$i}); 
      } 
     return 
    $result
     } 
     
     function 
    printrank($url){
      
    $ch "6".$this->GoogleCH($this->strord("info:" $url)); 
      
      
    $fp fsockopen("http://www.google.com/"80$errno$errstr30);
      if (!
    $fp) {
         echo 
    "$errstr ($errno)<br />\n";
      } else {
         
    $out "GET /search?client=navclient-auto&ch=" $ch .  "&features=Rank&q=info:" $url " HTTP/1.1\r\n" ;
         
    $out .= "Host: www.google.com\r\n" ;
         
    $out .= "Connection: Close\r\n\r\n" 
         
    fwrite($fp$out);
         while (!
    feof($fp)) {
           
    $data fgets($fp128);
           
    $pos strpos($data"Rank_");
             if(
    $pos === false){
             }else{
               
    $pagerank substr($data$pos 9);
               
    $this->pr_image($pagerank);
             }
         }
         
    fclose($fp); 
      }
     }
    //display pagerank image. Create your own or download images I made for this script. If you make your own make sure to call them pr0.gif, pr1.gif, pr2.gif etc.
     
    function pr_image($pagerank){
      if(
    $pagerank == 0){
       
    $this->pr "<img src=\"images/pr0.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }elseif(
    $pagerank == 1){
       
    $this->pr "<img src=\"images/pr1.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }elseif(
    $pagerank == 2){
       
    $this->pr "<img src=\"images/pr2.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }elseif(
    $pagerank == 3){
       
    $this->pr "<img src=\"images/pr3.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }elseif(
    $pagerank == 4){
       
    $this->pr "<img src=\"images/pr4.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }elseif(
    $pagerank == 5){
       
    $this->pr "<img src=\"images/pr5.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }elseif(
    $pagerank == 6){
       
    $this->pr "<img src=\"images/pr6.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }elseif(
    $pagerank == 7){
       
    $this->pr "<img src=\"images/pr7.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }elseif(
    $pagerank == 8){
       
    $this->pr "<img src=\"images/pr8.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }elseif(
    $pagerank == 9){
       
    $this->pr "<img src=\"images/pr9.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
       }else{
       
    $this->pr "<img src=\"images/pr10.gif\" alt=\"PageRank " .$pagerank" out of 10\">" ;
      }
     }
     function 
    get_pr(){
      return 
    $this->pr;
     }
    }
    ?>
    test.php
    PHP Code:
    <?php
    include("pagerank.php");
    $gpr = new pageRank();
    $gpr->printrank("http://www.sitepoint.com/");
    //display image
    echo $gpr->get_pr();
    ?>
    i waiting answers and thnks for help

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What doesn't work for you? What happens that isn't expected? Do you get any errors?

  3. #3
    SitePoint Zealot php.net's Avatar
    Join Date
    Oct 2003
    Location
    php.net
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont see any results for it, give me blank page

  4. #4
    SitePoint Zealot darksystem's Avatar
    Join Date
    Jan 2005
    Location
    Fayettville, North Carolina
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also tried that script but it gives me a blank page.
    Hopefully somebody will give their ideas.
    Ebay API, OSC/CRE/OscMax/ZenCart/SEO Services
    Lucki Multimedia - Email

  5. #5
    Passionate Web Developer Egyptechno's Avatar
    Join Date
    Jan 2004
    Location
    Dubai
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    same here ..

    Iam just wondering .. how did you know all this caluclations ?

  6. #6
    SitePoint Zealot darksystem's Avatar
    Join Date
    Jan 2005
    Location
    Fayettville, North Carolina
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I knw why we're getting blank page is we dont have the images to display lol
    Ebay API, OSC/CRE/OscMax/ZenCart/SEO Services
    Lucki Multimedia - Email

  7. #7
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Egyptechno
    same here ..

    Iam just wondering .. how did you know all this caluclations ?
    This is a class wrapped around a PHP script that's been circulating the net for well over a year. Someone figured out the checksum algorithm and then someone else translated it into PHP.

    I know the functions this script uses from that other script work correctly as I've used them.

  8. #8
    SitePoint Zealot
    Join Date
    Aug 2005
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This script works, I've been using it for a while (I modified the original to display a graphic representation).

    Original script:

    http://www.searchengineengine.com/fi...erank-code.txt

    Hope that helps.
    Last edited by Jack_In_The_Box; Aug 5, 2006 at 14:17.

  9. #9
    SitePoint Zealot php.net's Avatar
    Join Date
    Oct 2003
    Location
    php.net
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all for this replay
    but Jack_In_The_Box i test your code and i get :
    PHP Code:
    PageRank of www.google.com is:
    N/
    all results for URL's N/A

    thanks

  10. #10
    SitePoint Zealot
    Join Date
    Aug 2005
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code works, I just tested it.

    Here it goes again, I've removed some COMMENTS.

    PHP Code:

    <?php
    /*
        This code is released unto the public domain
        This script is originally from: http://www.googlecommunity.com/scripts/google-pagerank.php
        It is also hosted, and was modified slightly, by: http://www.searchengineengine.com
        The architecture is:
            getrank($url) function - The function called externally to get the PageRank
                strord($url) function - Function called by getrank() to convert the url string into a numeric 

    string
                GoogleCH($numericstring) function - Function called by getrank() to get the checksum of the url
                    mix($a, $b, $c) function - Called by GoogleCH() during checksum calculation
                        zeroFill($a, $b) function - Called by mix() during mixing
    */

    //header("Content-Type: text/plain; charset=utf-8");        //Uncommenting this makes the file downloadable rather 

    than executable

    define
    ("GOOGLE_MAGIC"0xE6359A60);        //Define the named constant "GOOGLE_MAGIC"

    //unsigned shift right
    function zeroFill($a$b) { 
        
    $z hexdec(80000000);
        if (
    $z $a) {
            
    $a = ($a>>1);
            
    $a &= (~$z);
            
    $a |= 0x40000000;
            
    $a = ($a>>($b-1));
        }
        else {
            
    $a = ($a>>$b);
        }
        return 
    $a;
    }

    function 
    mix($a$b$c) {        //This function is used in the Google Checksum calculation
        
    $a -= $b;
        
    $a -= $c;
        
    $a ^= (zeroFill($c,13));
        
    $b -= $c;
        
    $b -= $a;
        
    $b ^= ($a<<8);
        
    $c -= $a;
        
    $c -= $b;
        
    $c ^= (zeroFill($b,13));
        
    $a -= $b;
        
    $a -= $c;
        
    $a ^= (zeroFill($c,12));
        
    $b -= $c;
        
    $b -= $a;
        
    $b ^= ($a<<16);
        
    $c -= $a;
        
    $c -= $b;
        
    $c ^= (zeroFill($b,5));
        
    $a -= $b;
        
    $a -= $c;
        
    $a ^= (zeroFill($c,3));
        
    $b -= $c;
        
    $b -= $a;
        
    $b ^= ($a<<10);
        
    $c -= $a;
        
    $c -= $b;
        
    $c ^= (zeroFill($b,15));
        return array(
    $a,$b,$c);
    }

    function 
    GoogleCH($url$length=null$init=GOOGLE_MAGIC) {        //Calculate the Google Checksum for a given URL
        
    if(is_null($length)) {
            
    $length sizeof($url);
        }
        
    $a $b 0x9E3779B9;
        
    $c $init;
        
    $k 0;
        
    $len $length;
        while(
    $len >= 12) {
            
    $a += ($url[$k+0] +($url[$k+1]<<8) +($url[$k+2]<<16) +($url[$k+3]<<24));
            
    $b += ($url[$k+4] +($url[$k+5]<<8) +($url[$k+6]<<16) +($url[$k+7]<<24));
            
    $c += ($url[$k+8] +($url[$k+9]<<8) +($url[$k+10]<<16)+($url[$k+11]<<24));
            
    $mix mix($a,$b,$c);
            
    $a $mix[0];
            
    $b $mix[1];
            
    $c $mix[2];
            
    $k += 12;
            
    $len -= 12;
        }
        
    $c += $length;
        switch(
    $len)            /* all the case statements fall through */
        
    {
            case 
    11$c+=($url[$k+10]<<24);
            case 
    10$c+=($url[$k+9]<<16);
            case 
    $c+=($url[$k+8]<<8);
                
    /* the first byte of c is reserved for the length */
            
    case $b+=($url[$k+7]<<24);
            case 
    $b+=($url[$k+6]<<16);
            case 
    $b+=($url[$k+5]<<8);
            case 
    $b+=($url[$k+4]);
            case 
    $a+=($url[$k+3]<<24);
            case 
    $a+=($url[$k+2]<<16);
            case 
    $a+=($url[$k+1]<<8);
            case 
    $a+=($url[$k+0]);
                
    /* case 0: nothing left to add */
        
    }
        
    $mix mix($a,$b,$c);
        return 
    $mix[2];
    }

    function 
    strord($string) {        //converts a string into an array of integers containing the numeric value of the 

    char
        
    for($i=0;$i<strlen($string);$i++) {
            
    $result[$i] = ord($string{$i});
        }
        return 
    $result;
    }

    function 
    getrank($url$prefix="info:"$datacenter="www.google.com") {                //This is the function 

    used to get the PageRank value.
            
    //If $prefix is "info:", then the Toolbar pagerank will be returned.
            //$datacenter sets the datacenter to get the results from. e.g., "www.google.com", "216.239.53.99", 

    "66.102.11.99".
        
    $url $prefix.$url;
        
    $ch GoogleCH(strord($url));        //Get the Google checksum for $url using the GoogleCH function.
        
    $file "http://$datacenter/search?client=navclient-auto&ch=6$ch&features=Rank&q=$url";
            
    //To get the Crawl Date instead of the PageRank, change "&features=Rank" to "&features=Crawldate"
            //To get detailed XML results, remove "&features=Rank"
        
    $oldlevel error_reporting(0);        //Suppress error reporting temporarily.
        
    $data file($file);
        
    error_reporting($oldlevel);            //Restart error reporting.
        
    if(!$data || preg_match("/(.*)\.(.*)/i"$url)==0) return "N/A";            //If the Google data is 

    unavailable, or the URL is invalid, return "N/A".
            
    //The preg_match check is a very basic url validator that only checks if the URL has a period in it.
        
    $rankarray explode (":"$data[2]);        //There are two line breaks before the PageRank data on the Google 

    page.
        
    $rank trim($rankarray[2]);        //Trim whitespace and line breaks.
        
    if($rank=="") return "N/A";            //Return N/A if no rank.
        
    return $rank;
    }

    function 
    getrealrank($url$datacenter="www.google.com"){
        
    $ch GoogleCH(strord($url));
        
    $array xmltoarray("http://$datacenter/search?client=navclient-auto&ch=6$ch&q=$url");
        
    $infoarray $array['GSP'][0]['RES'][0]['R'];
        
    $nonwwwurl str_replace("www."""$url);
        
    $urlpermutationsarray = array($url"http://".$url"http://www.".$url$url."/""http://".$url."/"

    "http://www.".$url."/"$nonwwwurl"http://".$nonwwwurl"http://www.".$nonwwwurl$nonwwwurl."/"

    "http://".$nonwwwurl."/""http://www.".$nonwwwurl."/"); 
        for(
    $i=0$i<count($infoarray); $i++){
            
    $urlU $infoarray[$i]['U'];        //U is the URL. UE is the 'clean' URL.
            
    $urlrank $infoarray[$i]['RK'];
            foreach(
    $urlpermutationsarray as $permutation){
                if(
    strtolower($permutation)==strtolower($urlU)) return $urlrank;        //Case insensitive 

    match.
            }
        }
        return 
    "Unknown";        //If no matches found.
    }

        
    //Example of how to use the getrank function.
    $url "www.google.com";
    echo 
    "PageRank of ".$url." is:<br />".getrank($url);


    ?>

  11. #11
    SitePoint Zealot php.net's Avatar
    Join Date
    Oct 2003
    Location
    php.net
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Jack_In_The_Box,

    But the results is same

    PHP Code:
    PageRank of www.google.com is:
    N/
    thanks

  12. #12
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That code only returns "N/A" for me as well. This works:

    PHP Code:
    <?php
    // PHP Google PageRank Calculator Script
    // -------------------------- April 2005
    // Contact author: pagerankscript@googlecommunity.com

    // for updates, visit:
    // http://www.googlecommunity.com/scripts/google-pagerank.php

    // provided by www.GoogleCommunity.com
    //  an unofficial community of Google fans
    // ---------------------------------------

    /*
        This code is released unto the public domain
    */
    define('GOOGLE_MAGIC'0xE6359A60);

    //unsigned shift right
    function zeroFill($a$b)
    {
        
    $z hexdec(80000000);
            if (
    $z $a)
            {
                
    $a = ($a>>1);
                
    $a &= (~$z);
                
    $a |= 0x40000000;
                
    $a = ($a>>($b-1));
            }
            else
            {
                
    $a = ($a>>$b);
            }
            return 
    $a;
    }

    function 
    mix($a,$b,$c) {
      
    $a -= $b$a -= $c$a ^= (zeroFill($c,13));
      
    $b -= $c$b -= $a$b ^= ($a<<8);
      
    $c -= $a$c -= $b$c ^= (zeroFill($b,13));
      
    $a -= $b$a -= $c$a ^= (zeroFill($c,12));
      
    $b -= $c$b -= $a$b ^= ($a<<16);
      
    $c -= $a$c -= $b$c ^= (zeroFill($b,5));
      
    $a -= $b$a -= $c$a ^= (zeroFill($c,3));
      
    $b -= $c$b -= $a$b ^= ($a<<10);
      
    $c -= $a$c -= $b$c ^= (zeroFill($b,15));

      return array(
    $a,$b,$c);
    }

    function 
    GoogleCH($url$length=null$init=GOOGLE_MAGIC) {
        if(
    is_null($length)) {
            
    $length sizeof($url);
        }
        
    $a $b 0x9E3779B9;
        
    $c $init;
        
    $k 0;
        
    $len $length;
        while(
    $len >= 12) {
            
    $a += ($url[$k+0] +($url[$k+1]<<8) +($url[$k+2]<<16) +($url[$k+3]<<24));
            
    $b += ($url[$k+4] +($url[$k+5]<<8) +($url[$k+6]<<16) +($url[$k+7]<<24));
            
    $c += ($url[$k+8] +($url[$k+9]<<8) +($url[$k+10]<<16)+($url[$k+11]<<24));
            
    $mix mix($a,$b,$c);
            
    $a $mix[0]; $b $mix[1]; $c $mix[2];
            
    $k += 12;
            
    $len -= 12;
        }

        
    $c += $length;
        switch(
    $len)              /* all the case statements fall through */
        
    {
            case 
    11$c+=($url[$k+10]<<24);
            case 
    10$c+=($url[$k+9]<<16);
            case 
    $c+=($url[$k+8]<<8);
              
    /* the first byte of c is reserved for the length */
            
    case $b+=($url[$k+7]<<24);
            case 
    $b+=($url[$k+6]<<16);
            case 
    $b+=($url[$k+5]<<8);
            case 
    $b+=($url[$k+4]);
            case 
    $a+=($url[$k+3]<<24);
            case 
    $a+=($url[$k+2]<<16);
            case 
    $a+=($url[$k+1]<<8);
            case 
    $a+=($url[$k+0]);
             
    /* case 0: nothing left to add */
        
    }
        
    $mix mix($a,$b,$c);
        
    /*-------------------------------------------- report the result */
        
    return $mix[2];
    }

    //converts a string into an array of integers containing the numeric value of the char
    function strord($string) {
        for(
    $i=0;$i<strlen($string);$i++) {
            
    $result[$i] = ord($string{$i});
        }
        return 
    $result;
    }

    function 
    getrank($url) {
        
    $url 'info:'.$url;
        
    $ch GoogleCH(strord($url));
        
    $file "http://www.google.com/search?client=navclient-auto&ch=6$ch&features=Rank&q=$url";
        
    $data file($file);
        
    $rankarray explode (':'$data[2]);
        
    $rank $rankarray[2];
        return 
    $rank;
    }

    echo 
    "PageRank for www.google.com is " getrank('www.google.com');

    ?>
    Code:
    [root@silver tools]# php prtest.php
    PageRank for www.google.com is 10

  13. #13
    SitePoint Guru MikeBigg's Avatar
    Join Date
    Jun 2004
    Location
    Reading, UK
    Posts
    970
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dan,

    that only ever returns 10 for me ... I tried a few sites.

    edit: my mistake, I was testing it wrongly.

    Mike

  14. #14
    SitePoint Zealot php.net's Avatar
    Join Date
    Oct 2003
    Location
    php.net
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dan,

    I test your code and i get this result
    PHP Code:
    Warningfile(http://www.google.com/search?client=navclient-auto&ch=6-2147435329&features=Rank&q=info:www.google.com): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/****/public_html/google.php on line 102
    PageRank for www.google.com is 
    whats worng

    thanks for your help

  15. #15
    SitePoint Zealot
    Join Date
    Aug 2005
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude, what exactly are you doing?, I mean, my code and Dan's works for me.

  16. #16
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That checksum is wrong. It's not the checksum the script computes on my servers. I have no idea why it'd be wrong.

    Code:
    YOURS:
    http://www.google.com/search?client=navclient-auto&ch=6-2147435329&features=Rank&q=info:www.google.com
    
    MINE:
    http://www.google.com/search?client=navclient-auto&ch=6340563836&features=Rank&q=info:www.google.com

  17. #17
    SitePoint Zealot
    Join Date
    Aug 2005
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like this script DOESN'T work on some servers, read the FAQ at the bottom of the page.

    http://www.googlecommunity.com/scrip...e-pagerank.php

    Both scripts work on mine though.

  18. #18
    SitePoint Zealot php.net's Avatar
    Join Date
    Oct 2003
    Location
    php.net
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jack_In_The_Box , Dan Grossman i test this Dan code in other server it worked fine for me but i dont konw why not working with my server.

    and any one know other script working with images for ranking like first code here

    Thanks for all help

  19. #19
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by php.net
    Jack_In_The_Box , Dan Grossman i test this Dan code in other server it worked fine for me but i dont konw why not working with my server.

    and any one know other script working with images for ranking like first code here

    Thanks for all help
    Adding images is trivial, but you can't do it with any script if you can't compute the checksum first.

  20. #20
    SitePoint Zealot php.net's Avatar
    Join Date
    Oct 2003
    Location
    php.net
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Dan,

    for your help,but working with checksum so hard and i see first script with images but not working with me in any server.

    Thanks again

  21. #21
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this might be more to do with Google than you as I've had the exact same problem in the past. Whilst testing a page rank script it suddenly stopped working with the same error you are getting, I think maybe Google blocks your IP after a while if you are persistently hammering it as you might do during testing. The same script that failed one day just started working a few days later as if the block had been removed.

  22. #22
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markl999
    I think this might be more to do with Google than you as I've had the exact same problem in the past. Whilst testing a page rank script it suddenly stopped working with the same error you are getting, I think maybe Google blocks your IP after a while if you are persistently hammering it as you might do during testing. The same script that failed one day just started working a few days later as if the block had been removed.
    Yes that happens, but it's not the case here. The scripts are not computing the checksum value correctly on his server, so he will get a 403 error even if his server is not blocked. I can test it in my browser -- send a wrong checksum, get a 403, send a correct checksum, get pagerank info back.

  23. #23
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman
    Yes that happens, but it's not the case here. The scripts are not computing the checksum value correctly on his server, so he will get a 403 error even if his server is not blocked. I can test it in my browser -- send a wrong checksum, get a 403, send a correct checksum, get pagerank info back.

    I have the same exact problem with only one of my servers. It works everywhere else but on one specific machine and I have verfied by remotely querying via curl that the server is NOT blocked.

    As best I can tell function strord() passes the correct array elements however the function GoogleCH() function is lousing something up. I had even recompiled php to the same version as I have running on my laptop however using the same exact code on both produces different checksums.

    To debug I compiled a C version (gcc pr.c) and it does in fact calculate the correct checksum.... php does not. If anyone has any ideas Id love to hear them LOL

    The affected server is a Centos 4 machine running php 5.1.5 on Intel (2.6.9-11.ELsmp #1 SMP Wed Jun 8 17:54:20 CDT 2005 i686 i686 i386 GNU/Linux)

  24. #24
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BTW: this is the kind of thing you can just beat your head against the wall debugging... lol


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
  •