Activity Stream
48,167 MEMBERS
65201 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1.     
    #11
    Member
    Website's:
    InstantRDP.com
    Code: 
    require_once 'class.alexa.php';
     $alexa = new Alexa();
      echo $alexa->getRank("http://www.besthostingforums.com");




  2.   Sponsored Links

  3.     
    #12
    Member
    Website's:
    InstantRDP.com
    This code is way too simple to understand, so let's use this out.

    PHP Code: 
    <?php
    function alexaRank($domain){
        
    $remote_url 'http://data.alexa.com/data?cli=10&dat=snbamz&url='.trim($domain);
        
    $search_for '<POPULARITY URL';
        if (
    $handle = @fopen($remote_url"r")) {
            while (!
    feof($handle)) {
                
    $part .= fread($handle100);
                
    $pos strpos($part$search_for);
                if (
    $pos === false)
                continue;
                else
                break;
            }
            
    $part .= fread($handle100);
            
    fclose($handle);
        }
        
    $str explode($search_for$part);
        
    $str array_shift(explode('"/>'$str[1]));
        
    $str explode('TEXT="'$str);

        return 
    $str[1];
    echo 
    $str[1];
    echo 
    "Pankaj";
    }
    ?>
    But its printing nothing. See warez-core.com/a.php




  4.     
    #13
    Respected Developer
    Website's:
    PlatinumW.org NexusDDL.com HD-United.org CheckLinks.org FLVD.org
    Just noticed you never called the function. Also you can't have anything after a return statement.

    Code: 
    <?php
    function alexaRank($domain){
        $remote_url = 'http://data.alexa.com/data?cli=10&dat=snbamz&url='.trim($domain);
        $search_for = '<POPULARITY URL';
        if ($handle = @fopen($remote_url, "r")) {
            while (!feof($handle)) {
                $part .= fread($handle, 100);
                $pos = strpos($part, $search_for);
                if ($pos === false)
                continue;
                else
                break;
            }
            $part .= fread($handle, 100);
            fclose($handle);
        }
        $str = explode($search_for, $part);
        $str = array_shift(explode('"/>', $str[1]));
        $str = explode('TEXT="', $str);
    
        return $str[1];
    }
    echo alexaRank('test.com');?>

  5.     
    #14
    Member
    Website's:
    InstantRDP.com
    Thank you DMAN. It's working fine.




  6.     
    #15
    Member
    Alright im going to close the thread as its all fixed. PM me if you want it re opened for future help.
    Please follow signature rules

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Alexa Certify Code help
    By atyup in forum Webmaster Discussion
    Replies: 0
    Last Post: 22nd Jul 2012, 09:13 PM
  2. [Code]Tag showing black color
    By saini in forum vBulletin
    Replies: 7
    Last Post: 2nd Jan 2012, 07:14 AM
  3. Help about HTML Code for a Box
    By Deadmau5 in forum Web Application/Script Support
    Replies: 1
    Last Post: 19th Nov 2011, 12:52 PM
  4. Embedded code not showing in homepage
    By conrey in forum Wordpress
    Replies: 8
    Last Post: 5th Oct 2011, 05:51 AM
  5. HTML Code Help
    By S?nic in forum Technical Help Desk Support
    Replies: 4
    Last Post: 24th Aug 2009, 07:37 AM

Tags for this Thread

BE SOCIAL