+ Reply to Thread
Results 1 to 4 of 4

Thread: PHP Server Status

  1. #1
    johnnei is offline x10Hosting Member johnnei is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    20

    PHP Server Status

    Ey,

    Why is this script not working correctly on x10hosting? Cause on my own "beta test" server (the place where i test before putting on) it does work:

    PHP Code:
    <?php
        
    function smallStats() {
        
        
    $serverip "CENSORED";
        
    $serverport    "27960";
        
    $fserver = @fsockopen ($serverip ,$serverport$err$errstr1);
        if ( 
    $fserver )
            
    $serverstatus '<font color="#00ff00"><font class="serverOnline">Online</font></font>';
        else {
            
    $serverstatus '<font color="#ff0000"><font class="serverOffline">Offline</font></font>';
             }
        
        echo 
    '<h2>#m&m. Fun Server</h2>';
        echo 
    'Server: ' $serverstatus;
        }
    ?>
    I filled in multiple ip's to test but none of them gave correct result...

    Anybody knows why?

    Gr, Johnnei

  2. #2
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: PHP Server Status

    x10 might not allow fsockopen.

  3. #3
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: PHP Server Status

    Quote Originally Posted by xgreenberetx View Post
    x10 might not allow fsockopen.
    It does allow fsockopen.

    Run:


    PHP Code:
    <?php
        
    function smallStats() {
        
        
    $serverip "216.245.205.66";
        
    $serverport    "2082";
        
    $fserver fsockopen ($serverip ,$serverport$err$errstr1);
        if ( 
    $fserver )
            
    $serverstatus '<font color="#00ff00"><font class="serverOnline">Online</font></font>';
        else {
            
    $serverstatus '<font color="#ff0000"><font class="serverOffline">Offline</font></font>';
             }
        
        echo 
    '<h2>#m&m. Fun Server</h2>';
        echo 
    'Server: ' $serverstatus;
        }
        
    smallStats() ;
    ?>
    1. Remove the '@' in front of fsocketopen. That way you will see any warnings.
    2. With various combinations, you will get 'Connection Refused'. So problem is at one end or the other.
    3. Only certain ports are open in x10hosting, which may cause a problem.
    Last edited by descalzo; 12-29-2009 at 10:42 AM.
    Nothing is always absolutely so.

  4. #4
    johnnei is offline x10Hosting Member johnnei is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    20

    Re: PHP Server Status

    I'll test the script and it doesn't search for x10hosting it is searching for my wolfenstein server on my computer where all correct ports are open i'll let you know if it worked
    edit:
    It now just says the server is online no matter what any other suggestions?
    Last edited by johnnei; 12-30-2009 at 04:10 AM.

+ Reply to Thread

Similar Threads

  1. Forum game <King of the hill>
    By Jacob, Kid Mania Creator in forum Forum Games
    Replies: 1191
    Last Post: 02-15-2010, 01:19 PM
  2. PHP - opening a socket to a ventrilo server
    By Rolus in forum Programming Help
    Replies: 5
    Last Post: 03-12-2009, 02:34 PM
  3. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 01:58 PM
  4. "PHP Startup: Invalid Library" - Interesting error
    By javaguy78 in forum Free Hosting
    Replies: 5
    Last Post: 03-27-2007, 02:33 PM
  5. PHP Server Status.
    By Nathan in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 07-12-2005, 08:47 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
x10hosting free hosting for the masses
dedicated servers