3raser Posted November 9, 2009 Share Posted November 9, 2009 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 https://forums.phpfreaks.com/topic/180809-my-status-keeps-saying-offline-why-shrugs/ Share on other sites More sharing options...
3raser Posted November 9, 2009 Author Share Posted November 9, 2009 I have to go soon.... Link to comment https://forums.phpfreaks.com/topic/180809-my-status-keeps-saying-offline-why-shrugs/#findComment-953881 Share on other sites More sharing options...
3raser Posted November 10, 2009 Author Share Posted November 10, 2009 Anyone? Link to comment https://forums.phpfreaks.com/topic/180809-my-status-keeps-saying-offline-why-shrugs/#findComment-954497 Share on other sites More sharing options...
3raser Posted November 10, 2009 Author Share Posted November 10, 2009 Does anyone on this freaking forum know?! Link to comment https://forums.phpfreaks.com/topic/180809-my-status-keeps-saying-offline-why-shrugs/#findComment-954541 Share on other sites More sharing options...
joel24 Posted November 10, 2009 Share Posted November 10, 2009 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 https://forums.phpfreaks.com/topic/180809-my-status-keeps-saying-offline-why-shrugs/#findComment-954548 Share on other sites More sharing options...
3raser Posted November 12, 2009 Author Share Posted November 12, 2009 The variables are working. And here is my error; Warning: fsockopen() [function.fsockopen]: unable to connect to hey:43594 (Connection refused) in /home/a9726309/public_html/index.php on line 16 Link to comment https://forums.phpfreaks.com/topic/180809-my-status-keeps-saying-offline-why-shrugs/#findComment-955919 Share on other sites More sharing options...
joel24 Posted November 12, 2009 Share Posted November 12, 2009 shouldn't the error be something like "unable to connect to 123.493.495.34:43594 (Connection refused)" ... instead of "unable to connect to hey:43594 (Connection refused)"...? Link to comment https://forums.phpfreaks.com/topic/180809-my-status-keeps-saying-offline-why-shrugs/#findComment-956037 Share on other sites More sharing options...
ThunderLee Posted November 12, 2009 Share Posted November 12, 2009 I get this: Warning: fsockopen() [function.fsockopen]: unable to connect to www.mymediaupload.com:43594 (Connection timed out) in /home/a9726309/public_html/index.php on line 16 Meh idk o.o.. Link to comment https://forums.phpfreaks.com/topic/180809-my-status-keeps-saying-offline-why-shrugs/#findComment-956098 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.