hello, i am currently making a server status page for these private servers of this game. i have a PERFECT code thats got everything i need:
<?php
$live = "http://i44.tinypic.com/352fzow.png";
$dead = "http://i40.tinypic.com/15foej8.png";
$link = $_GET['link'].":";
$s_link = str_replace("::", ":", $link);
list($addr,$port)= explode (':',"$s_link");
if (empty($port)){
$port = 43594;
}
//Test the server connection
$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
if (!$churl){
//echo $errstr;
header("Location: $dead");
}
else {
header("Location: $live");
}
function server($addr){
if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
return $addr;
}
?>
so yeh thats that then theres a test html code:
<html>
<head>
<title>Web Server Status</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<tr>
<td width="23%"><img src="status.php?link=lightscape2.no-ip.org" width="370" height="200"></td>
</tr>
</body>
</html>
yeh so thats that but..... it always says its offline?!?!?!?!? and i know for a FACT its online BECAUSE I HAVE BEEN ON IT AST SAME TIME!
this code is perfect for what i want it for because it has a php image (E.G. http://mysite.com/status.php?link=lightscape2.no-ip.org)
that will open the image through the php code so it can be added to a forum, site, ect.....
so if any one knows how to fix or how to make another one that openes the image through PHP then please post here. THANKS