Jump to content

My status - Keeps saying offline, why? (Shrugs)


3raser

Recommended Posts

http://runelocus.com/status/ - Here are some statuses of online servers

 

Try and input one of them here: http://webmasters.webatu.com/index.php

 

Why does it keep saying offline? Code:

 

<form action='index.php' method='GET'>Server IP: <input type='text' name='server' /> Server port: (Default is 43594)<input type='text' name='port' value='43594'/><input type='submit' value='Register my status!'></form>
<?php

$server = $_GET['server'];
$port = $_GET['port'];

if (!$server || !$port)
   {
   die("");
   }

error_reporting(0);
$checkport = fsockopen($server, $port, $errnum, $errstr, 2);
if(!$checkport) { die('<img src="offline.png" />'); } //ErrorHandel

else {
$my_img = imagecreatefrompng ( "online.png" );
$background = imagecolorallocate( $my_img, 111, 111, 111 );
$text_colour = imagecolorallocate( $my_img, 222, 222, 222 );
imagestring( $my_img, 5, 55, 68, $site, $text_colour );
imagesetthickness ( $my_img, 5 );
header( "Content-type: image/png" );
imagepng( $my_img );
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $my_img );
fclose($fp);
}

?>

Link to comment
Share on other sites

first up,

you should have error_reporting set to E_ALL for this if your debugging, not error_reporting(0);

second you have the timeout set to 2seconds, up it to 15 for testing.

 

and third try echoing $server and $port to ensure the correct values are getting passed.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.