if (always_true){
Quote from: php<?php$fp = fsockopen("udp://74.54.186.226", 27910, $errno, $errstr);if (!$fp) { echo "ERROR: $errno - $errstr<br />\n";} else { fwrite($fp, "ÿÿÿÿping\n"); $coutput = fread($fp, 26); $cresponse = "ack\n";if(strstr($coutput,$cresponse)){echo "print HTML server up";}else{echo "print HTML server down";}fclose($fp);}?>
<?php$fp = fsockopen("udp://74.54.186.226", 27910, $errno, $errstr);if (!$fp) { echo "ERROR: $errno - $errstr<br />\n";} else { fwrite($fp, "ÿÿÿÿping\n"); $coutput = fread($fp, 26); $cresponse = "ack\n";if(strstr($coutput,$cresponse)){echo "print HTML server up";}else{echo "print HTML server down";}fclose($fp);}?>
<?php$serv1 = @fsockopen("udp://www.aceintergraphs.com", 27910, $errno, $errstr);$serv2 = @fsockopen("udp://www.aceintergraphs.com", 27911, $errno, $errstr);$serv3 = @fsockopen("udp://www.aceintergraphs.com", 27912, $errno, $errstr);$serv4 = @fsockopen("udp://www.aceintergraphs.com", 27913, $errno, $errstr);$serv5 = @fsockopen("udp://www.aceintergraphs.com", 27914, $errno, $errstr);$serv6 = @fsockopen("udp://www.aceintergraphs.com", 27915, $errno, $errstr);$serv7 = @fsockopen("udp://www.aceintergraphs.com", 27916, $errno, $errstr);$serv8 = @fsockopen("udp://www.aceintergraphs.com", 27917, $errno, $errstr);$serv9 = @fsockopen("udp://www.aceintergraphs.com", 27918, $errno, $errstr);$serv10 = @fsockopen("udp://www.aceintergraphs.com", 27919, $errno, $errstr);$serv11 = @fsockopen("udp://www.aceintergraphs.com", 27920, $errno, $errstr);$serv12 = @fsockopen("udp://www.aceintergraphs.com", 27921, $errno, $errstr);if (!$serv1){ echo '<br>Fezonia'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Fezonia Realm is Offline">';}else{ fwrite($serv1, "����ping\n"); fread($serv1, 26); echo '<br>Fezonia'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Fezonia Realm is Online">'; fclose($serv1);}if (!$serv2){ echo '<br>Feasa'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Feasa Realm is Offline">';}else{ fwrite($serv2, "����ping\n"); fread($serv2, 26); echo '<br>Feasa'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Feasa Realm is Online">'; fclose($serv2);}if (!$serv3){ echo '<br>Harlband'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Harlband Real is Offline">';}else{ fwrite($serv3, "����ping\n"); fread($serv3, 26); echo '<br>Harlband'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Harlband Real is Online">'; fclose($serv3);}if (!$serv4){ echo '<br>Sodoara'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Sodoara Real is Offline">';}else{ fwrite($serv4, "����ping\n"); fread($serv4, 26); echo '<br>Sodoara'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Sodoara Real is Online">'; fclose($serv4); }if (!$serv5){ echo '<br>Binndroa'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Binndroa Real is Offline">';}else{ fwrite($serv5, "����ping\n"); fread($serv5, 26); echo '<br>Binndroa'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Binndroa Real is Online">'; fclose($serv5);}if (!$serv6){ echo '<br>Elboria'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Elboria Realm is Offline">';}else{ fwrite($serv6, "����ping\n"); fread($serv6, 26); echo '<br>Elboria'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Elboria Realm is Online">'; fclose($serv6);}if (!$serv7){ echo '<br>Eskaara'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Eskaara Real is Offline">';}else{ fwrite($serv7, "����ping\n"); fread($serv7, 26); echo '<br>Eskaara'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Eskaara Real is Online">'; fclose($serv7);}if (!$serv8){ echo '<br>Eldorian'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Eldorian Realm is Offline">';}else{ fwrite($serv8, "����ping\n"); fread($serv8, 26); echo '<br>Eldorian'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Eldorian Realm is Online">'; fclose($serv8);}if (!$serv9){ echo '<br>Shamka'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Shamka Realm is Offline">';}else{ fwrite($serv9, "����ping\n"); fread($serv9, 26); echo '<br>Shamka'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Shamka Realm is Online">'; fclose($serv9);}if (!$serv10){ echo '<br>Redaila'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Redaila Realm is Offline">';}else{ fwrite($serv10, "����ping\n"); fread($serv10, 26); echo '<br>Redaila'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Redaila Realm is Online">'; fclose($serv10);}if (!$serv11){ echo '<br>Skara'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Skara Realm is Offline">';}else{ fwrite($serv11, "����ping\n"); fread($serv11, 26); echo '<br>Skara'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Skara Realm is Online">'; fclose($serv11);}if (!$serv12){ echo '<br>Prison'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Prison is Offline">';}else{ fwrite($serv12, "����ping\n"); fread($serv12, 26); echo '<br>Prison'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Prison is Online">'; fclose($serv12);}?>
Quote from: console on December 21, 2010, 02:29:05 PMif (always_true){I can use this? or is this just an example?
Sorry Mr. Moderator, but spending 2 to 3 days working on somehting that don;t work experiementing with all types of commands
Warning: fwrite(): 17 is not a valid stream resource in F:\xampp\htdocs\onlinestatus.php on line 188
<?php$serv1 = @fsockopen("udp://aceintergraphs.com", 27910, $errno, $errstr);$serv2 = @fsockopen("udp://aceintergraphs.com", 27911, $errno, $errstr);$serv3 = @fsockopen("udp://aceintergraphs.com", 27912, $errno, $errstr);$serv4 = @fsockopen("udp://aceintergraphs.com", 27913, $errno, $errstr);$serv5 = @fsockopen("udp://aceintergraphs.com", 27914, $errno, $errstr);$serv6 = @fsockopen("udp://aceintergraphs.com", 27915, $errno, $errstr);$serv7 = @fsockopen("udp://aceintergraphs.com", 27916, $errno, $errstr);$serv8 = @fsockopen("udp://aceintergraphs.com", 27917, $errno, $errstr);$serv9 = @fsockopen("udp://aceintergraphs.com", 27918, $errno, $errstr);$serv10 = @fsockopen("udp://aceintergraphs.com", 27919, $errno, $errstr);$serv11 = @fsockopen("udp://aceintergraphs.com", 27920, $errno, $errstr);$serv12 = @fsockopen("udp://aceintergraphs.com", 27921, $errno, $errstr);if (!$serv1){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv1, "ÿÿÿÿping\n"); $read1 = fread($serv1, 26); $res1 = "ack\n"; if(strstr($read1,$res1)){ echo '<br>Fezonia'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Fezonia Realm is Offline">';}else{ echo '<br>Fezonia'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Fezonia Realm is Online">';}fclose($serv1);}if (!$serv2){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv2, "ÿÿÿÿping\n"); $read2 = fread($serv2, 26); $res2 = "ack\n"; if(strstr($read2,$res2)){ echo '<br>Feasa'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Feasa Realm is Offline">';}else{ echo '<br>Feasa'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Feasa Realm is Online">';}fclose($serv2);}if (!$serv3){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv3, "ÿÿÿÿping\n"); $read3 = fread($serv3, 26); $res3 = "ack\n"; if(strstr($read3,$res3)){ echo '<br>Harlband'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Harlband Realm is Offline">';}else{ echo '<br>Harlband'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Harlband Realm is Online">';}fclose($serv3);}if (!$serv4){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv4, "ÿÿÿÿping\n"); $read4 = fread($serv4, 26); $res4 = "ack\n"; if(strstr($read4,$res4)){ echo '<br>Sodoara'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Sodoara Realm is Offline">';}else{ echo '<br>Sodoara'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Sodoara Realm is Online">';}fclose($serv4);}if (!$serv5){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv5, "ÿÿÿÿping\n"); $read5 = fread($serv5, 26); $res5 = "ack\n"; if(strstr($read5,$res5)){ echo '<br>Binndroa'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Binndroa Realm is Offline">';}else{ echo '<br>Binndroa'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Binndroa Realm is Online">';}fclose($serv5);}if (!$serv6){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv6, "ÿÿÿÿping\n"); $read6 = fread($serv6, 26); $res6 = "ack\n"; if(strstr($read6,$res6)){ echo '<br>Elboria'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Elboria Realm is Offline">';}else{ echo '<br>Elboria'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Elboria Realm is Online">';}fclose($serv6);}if (!$serv7){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv7, "ÿÿÿÿping\n"); $read7 = fread($serv7, 26); $res7 = "ack\n"; if(strstr($read7,$res7)){ echo '<br>Eskaara'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Eskaara Realm is Offline">';}else{ echo '<br>Eskaara'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Eskaara Realm is Online">';}fclose($serv7);}if (!$serv8){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv8, "ÿÿÿÿping\n"); $read8 = fread($serv8, 26); $res8 = "ack\n"; if(strstr($read8,$res8)){ echo '<br>Eldorian'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Eldorian Realm is Offline">';}else{ echo '<br>Eldorian'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Eldorian Realm is Online">';}fclose($serv8);}if (!$serv9){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv9, "ÿÿÿÿping\n"); $read9 = fread($serv9, 26); $res9 = "ack\n"; if(strstr($read9,$res9)){ echo '<br>Shamka'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Shamka Realm is Offline">';}else{ echo '<br>Shamka'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Shamka Realm is Online">';}fclose($serv9);}if (!$serv10){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv10, "ÿÿÿÿping\n"); $read10 = fread($serv10, 26); $res10 = "ack\n"; if(strstr($read10,$res10)){ echo '<br>Redaila'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Redaila Realm is Offline">';}else{ echo '<br>Redaila'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Redaila Realm is Online">';}fclose($serv11);}if (!$serv11){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv11, "ÿÿÿÿping\n"); $read11 = fread($serv11, 26); $res11 = "ack\n"; if(strstr($read11,$res11)){ echo '<br>Skara'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Skara Realm is Offline">';}else{ echo '<br>Skara'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Skara Realm is Online">';}fclose($serv11);}if (!$serv12){ echo "ERROR: $errno - $errstr<br />\n";}else{ fwrite($serv12, "ÿÿÿÿping\n"); $read12 = fread($serv12, 26); $res12 = "ack\n"; if(strstr($read12,$res12)){ echo '<br>Prison'; echo '<img src="images/soffline.gif" width="100" height="8" alt="The Prison is Offline">';}else{ echo '<br>Prison'; echo '<img src="images/sonline.gif" width="100" height="8" alt="The Prison is Online">';}fclose($serv12);}?>
Quote from: Ace on December 21, 2010, 02:59:44 PMSorry Mr. Moderator, but spending 2 to 3 days working on somehting that don;t work experiementing with all types of commandsThis is written in a dickish way, but it makes some good points:http://www.catb.org/~esr/faqs/smart-questions.htmlIn particular, "So, while it isn't necessary to already be technically competent to get attention from us, it is necessary to demonstrate the kind of attitude that leads to competence..." * * *Programming requires taking the time to understand precisely what you're telling the system to do, and to understand precisely what you expect from the system in response.You keep pasting code with lines like the following: if (!$serv1)Most of the responses from reaper and me so far have highlighted the problems with how statements like if (!$serv1) are being used in your code.So let me ask you this: What do you think if (!$serv1) is telling the system to do?There are really no shortcuts here. You'll need to understand what each line of your program is doing and why.
There is no newline after the acknowledgement
if (!$serv){
ok I fixed that part, but still showing servers online when they are not.... so tell me guys, what am I doing wrong?