Author Topic: PHP problems on verification of server offline/online  (Read 13399 times)

Offline Ace

  • Full Member
  • ***
  • Posts: 143
  • Band, the MMORPGDM
    • View Profile
    • ACE Intergraphs
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #15 on: December 21, 2010, 02:39:26 PM »
if (always_true){

I can use this? or is this just an example?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
~~Ace~~

Offline console

  • Brobdingnagian Member
  • ***
  • Posts: 4518
  • "Man, this is the way to travel," said my attorney
    • View Profile
    • tastyspleen.net
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #16 on: December 21, 2010, 02:40:10 PM »
In theory, like this...

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

(Not sure about where it reads exactly 26 characters, though.)


:afro:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Ace

  • Full Member
  • ***
  • Posts: 143
  • Band, the MMORPGDM
    • View Profile
    • ACE Intergraphs
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #17 on: December 21, 2010, 02:53:22 PM »
OK whats wrong the code below?  Its still showing them all as online when only 3 servers are up! Remember I am trying to to do 12 servers at once for testing, not just 1, so some of your code may not apply...  or my code can be simplified?

Quote
<?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);
}
?>
« Last Edit: December 21, 2010, 02:55:20 PM by Ace »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
~~Ace~~

Offline console

  • Brobdingnagian Member
  • ***
  • Posts: 4518
  • "Man, this is the way to travel," said my attorney
    • View Profile
    • tastyspleen.net
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #18 on: December 21, 2010, 02:56:27 PM »
if (always_true){
I can use this? or is this just an example?



Sir, I'm going to have to ask you to step away from the keyboard.

:ubershock:

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Ace

  • Full Member
  • ***
  • Posts: 143
  • Band, the MMORPGDM
    • View Profile
    • ACE Intergraphs
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #19 on: December 21, 2010, 02:59:44 PM »
Sorry Mr. Moderator, but spending 2 to 3 days working on somehting that don;t work experiementing with all types of commands, I begin to wonder....  I do not know PHP that well you know, only enouhg to blow up buildings!  :biggungrin:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
~~Ace~~

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #20 on: December 21, 2010, 03:03:41 PM »
 :lolsign:

I don't know what the 26 is from.  I just grabbed the example from the fopensocket UDP documentation and altered it a bit.  However after changing the parameters, reading 26 bytes seemed fine, because I got the challange response back.  I believe it is reading 26bytes passed the UDP header.

Ace: you are sending a packet, and saying..if I send a packet the server is up.  See quadz post on the conditional.  You have been showing us a script that is saying basically (if x=x, then server is up).  This is because you don't test the response from the server.  You send a packet and say if you can send a packet the server is up.  The protocol is UDP so for the function to return something normal it doesn't have to do anything but send a packet.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #21 on: December 21, 2010, 03:26:16 PM »
I always think PHP looks weird, it almost looks like plain writing.  I like Perl better I think.


 :lolsign:

edit: FYI the Q2 net protocol has been decoded, although for just doing the challenge you don't need the decoder.  but if you want to look at it, check out wireshark and the q2 decoder.  They will show you the meaning of bytes at certain offsets in the communication.
« Last Edit: December 21, 2010, 03:38:04 PM by reaper »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

Offline console

  • Brobdingnagian Member
  • ***
  • Posts: 4518
  • "Man, this is the way to travel," said my attorney
    • View Profile
    • tastyspleen.net
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #22 on: December 21, 2010, 03:37:35 PM »
Sorry Mr. Moderator, but spending 2 to 3 days working on somehting that don;t work experiementing with all types of commands

This is written in a dickish way, but it makes some good points:

http://www.catb.org/~esr/faqs/smart-questions.html

In 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.


:exqueezeme:

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Ace

  • Full Member
  • ***
  • Posts: 143
  • Band, the MMORPGDM
    • View Profile
    • ACE Intergraphs
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #23 on: December 21, 2010, 03:40:24 PM »
I had an issue:  I uised your guys ideas, it still does nto work, and even though all statatements are simular only 3 servers are getting this error on my hTML web page Warning:

Quote
Warning: fwrite(): 17 is not a valid stream resource in F:\xampp\htdocs\onlinestatus.php on line 188

But this is teh Code so far:

Quote
<?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);
}
?>
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
~~Ace~~

Offline Ace

  • Full Member
  • ***
  • Posts: 143
  • Band, the MMORPGDM
    • View Profile
    • ACE Intergraphs
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #24 on: December 21, 2010, 03:47:10 PM »
Sorry Mr. Moderator, but spending 2 to 3 days working on somehting that don;t work experiementing with all types of commands

This is written in a dickish way, but it makes some good points:

http://www.catb.org/~esr/faqs/smart-questions.html

In 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.


:exqueezeme:



Your right, but if I am pissing you off I am sorry, or upsetting you....  when I program I play by ear and copy then create, I may not understand all the functions, but 75% of the time I have success, and I carry on my merry way not truely understanding what I just did, but eventually I will learn, I did this with Basic Programming untill I Understood it, its my process of learning,, sure later down the road I learn the rights and wrongs, but you got to remember the last month is my first time dabbling in PHP, and you have to admit its pretty damn good for amature, thats if you had been watching my web page ror even had the time to and seen the things I have done using PHP.  So yes, I am a compleate idiot, so forgive me....  BUT THATS NOT STOPPING ME FROM TRYING!  :exqueezeme:
« Last Edit: December 21, 2010, 03:51:32 PM by Ace »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
~~Ace~~

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #25 on: December 21, 2010, 03:52:59 PM »
There is no newline after the acknowledgement
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

Offline Ace

  • Full Member
  • ***
  • Posts: 143
  • Band, the MMORPGDM
    • View Profile
    • ACE Intergraphs
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #26 on: December 21, 2010, 03:56:22 PM »
There is no newline after the acknowledgement

If your refering to the code, I will look into it, if not ???  Also why is it still stating the servers are online?  If its the
Quote
if (!$serv){
bits let me know instead of beating arround the bush, I am dumb remember?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
~~Ace~~

Offline Ace

  • Full Member
  • ***
  • Posts: 143
  • Band, the MMORPGDM
    • View Profile
    • ACE Intergraphs
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #27 on: December 21, 2010, 03:58:30 PM »
ok I fixed that part, but still showing servers online when they are not....  so tell me guys, what am I doing wrong?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
~~Ace~~

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #28 on: December 21, 2010, 04:08:41 PM »
Quote from: Ace
ok I fixed that part, but still showing servers online when they are not....  so tell me guys, what am I doing wrong?

not reading the link quadz posted

get rid of the newline that you're searching for, because you don't need to search the response for it

if you do find an acknowledgment in the response, do you want to show the server as online or offline?

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

Offline Ace

  • Full Member
  • ***
  • Posts: 143
  • Band, the MMORPGDM
    • View Profile
    • ACE Intergraphs
  • Rated:
Re: PHP problems on verification of server offline/online
« Reply #29 on: December 21, 2010, 04:17:35 PM »
This is the function response the code is supposed to do in Basic:

If Server1 is Online, then display the picture and name of server on the HTML page corrisponding to it being Online,
Else Server1 is Offline, then display the picture and name of server on the HTML page corrisponding to it being Offline.

Same for the rest of the servers, see www.aceintergraphs.com for example at the left side panel....

Currently they all are Green, so sdo you have a sample code, that would do this, using the same code as above, just corrected?  I can type up the rest, and fix it up.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
~~Ace~~

 

El Box de Shoutamente

Last 10 Shouts:

 

Costigan_Q2

November 11, 2024, 06:41:06 AM
"Stay cozy folks.

Everything is gonna be fine."

There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.
 

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM
 

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.

Show 50 latest
Welcome, Guest. Please login or register.
November 12, 2024, 09:26:58 PM

Login with username, password and session length