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);
}

?>

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.