Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default anything rong with this code

    Hey im still having radio stats trouble, i trying the techtuts 1 just to build on it but i keep getting this error:
    Code:
    Warning: fsockopen() [function.fsockopen]: unable to connect to 193.192.248.244:1903 (Connection refused) in /home/habtune/public_html/Radio statistics/Test.php on line 11
    Heres the code:
    PHP Code:
    <?php 
    //To Install - Copy This Code With The Following Information Into Any .php File 
    //Login Information 
    $radiohost='IP HERE'
    $radioport='PORT HERE'
    $radioofflinemsg='Sorry, No dj is currently on air. The dj may be switching with the next dj, please check the timetable.'
    $radiopassword='PASS HERE'
    //Do Not Edit Below Here 
    $timeout='6'
    $listenlink='http://'.$radiohost.':'.$radioport.'/listen.pls'
    $radio=fsockopen("$radiohost"$radioport, &$errno, &$errstr$timeout); 
    if(!
    $radio){ 
    $success='2';  
    echo 
    $radioofflinemsg
    die(); 

    //Connection 
    if($success!='2'){ //If Connection 
    fputs($radio,"Get /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //Get 7.HTML 
    while(!feof($radio)){ 
    $page.=fgets($radio1000); 

    //Data 
    $page=ereg_replace(".*<body>"""$page); //Extract Data 
    $page=ereg_replace("</body>.*"","$page); //Extract Data 
    $numbers=explode(",",$page); //Extract Data 
    $currentlisteners=$numbers[0]; //Set Variable 
    $connected=$numbers[1]; //Set Variable 
    //Open Connection 
    $fp=fsockopen("$radiohost"$radioport, &$errno, &$errstr3); 
    if(!
    $fp){ //If Connection 
    $success2='2'
    echo 
    "The Radio Server Is Currently Offline"

    if(
    $success2!='2'){ //If Connected 
    fputs($fp,"Get /admin.cgi?pass=$radiopassword&mode=viewxml HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //Get XML Page 
    while(!feof($fp)){ 
    $page.= fgets($fp1000); 

    $security=explode(",",$page); 
    $security=explode("401",$security[7]); 
    $u='0'
    while(
    $security[$u]!=""){ 
    if(
    $security[1]!=''

    die(
    "Incorrect Server Password"); 

    $u++; 

    //Array 
    $loop=array("AVERAGETIME""SERVERGENRE""SERVERURL""SERVERTITLE""SONGTITLE""SONGURL""IRC""ICQ""AIM""WEBHITS""STREAMHITS""INDEX""LISTEN""PALM7",  
    "LOGIN""LOGINFAIL""PLAYED""COOKIE""ADMIN""UPDINFO""KICKSRC""KICKDST""UNBANDST""BANDST""VIEWBAN""UNRIPDST""VIEWRIP""VIEWXML",  
    "VIEWLOG""INVALID"); //Define All The Variables To Get (Delete Any Ones You Don't Want) 
    $y='0'
    while(
    $loop[$y]!=''){ //While There Are Things In The Loop 
    $pageed=ereg_replace(".*<$loop[$y]>"""$page); //Extract Data 
    $phpname=strtolower($loop[$y]); 
    $
    $phpname=ereg_replace("</$loop[$y]>.*"""$pageed); //Finish Extracting Data 
    if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE
    $
    $phpname=urldecode($$phpname); 
    $phpname $phpname
    $y++; 


    if(
    $connected=='1'
    $wordconnected="yes";  
    else  
    $wordconnected="no";  
    $peaklisteners=$numbers[2];  
    $maxlisteners=$numbers[3];  
    $reportedlisteners=$numbers[4];  
    $song=$numbers[6]; 
    $bitrate=$numbers[5]; 
    $site=explode(" "$servertitle); 
    $title=explode("DJ",$servertitle);  
    if(
    $wordconnected=="no" && $connected=="0"

    echo 
    $radioofflinemsg
    }else{ 
    echo
    "<div align=\"center\"> 
    <table align=\"center\"> 
    <tr> 
    <td align=\"center\"> 
    <a href=\"http://
    $serverurl\">$servertitle</a> 
    </td> 
    </tr> 
    <tr> 
    <td align=\"center\"> 
    <center>
    $reportedlisteners/$maxlisteners Listeners<br />Bitrate: ".$bitrate."Kbps<p> 
    Current Song: <br />
    $numbers[6]</p> 
    </td> 
    </tr> 
    <tr> 
    <td align=\"center\"> 
    <a href=
    $listenlink></a> 
    </td> 
    </tr> 
    <tr> 
    <td align=\"center\"><br /> 
     
    </td></tr> 
    </table> 
    </div> 
    "

    //Close Connection 
    fclose($radio); 


    ?>
    Line 11:
    PHP Code:
    $radio=fsockopen("$radiohost"$radioport, &$errno, &$errstr$timeout); 

    so if u can help

  2. #2
    Join Date
    Sep 2005
    Posts
    1,604
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    $radiohost='IP HERE';  
    $radioport='PORT HERE';  
    $radioofflinemsg='Sorry, No dj is currently on air. The dj may be switching with the next dj, please check the timetable.';  
    $radiopassword='PASS HERE';  
    //Do Not Edit Below Here 
    put your radio info in where it says

  3. #3
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default

    i have, just removed so ppl wont hack

  4. #4
    JoeComins Guest

    Default

    So youve removed that line?

    If you do, then you wont be able to use it. You need that info in.

  5. #5
    Join Date
    Mar 2005
    Location
    Kidlington, Oxford.
    Posts
    7,274
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by JoeComins View Post
    So youve removed that line?

    If you do, then you wont be able to use it. You need that info in.
    He means he removed the info so he could post it here.

  6. #6
    Join Date
    Sep 2005
    Posts
    1,604
    Tokens
    0

    Latest Awards:

    Default

    Ask for help on techtuts if your making it from there

  7. #7
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    the errors pretty obvious if you read it. "unable to connect to 193.192.248.244:1903"

    Aka that host is refuseing your connection meaning ether some of the details or wrong or its not working correctly

  8. #8
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default

    hmm proberly host as you say, as they gone mental last few days.

Posting Permissions

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