title: Checking server status - online/offline
body: <p>I have a loop showing info of many different servers from database.
  Now i am trying to write if they are online or offline.
  I have tried to write manually the ip address and port to the srcipt and it works fine. However when i tried to put the table into the variable it shows that all are offline. Most of them use 44405 port so i put it manually for now to check it.</p>
  
  <p>EDIT: yes i know that this mysql code is ready and waiting for injection :D</p>
  
  <pre><code>&lt;?php //-----loading servers to website-----
  error_reporting(E_ALL); 
  ini_set('display_errors','1');
  
  $connection = //deleted this part coz includes personal info :D
  
  
  $alldata = mysql_query("SELECT * FROM muonline ORDER BY id DESC;");
  while ($loadservers = mysql_fetch_assoc($alldata)) {
  
  
  echo "&lt;tr&gt;";
  
    echo '&lt;td&gt;';  //-----here starts the online/offline part of script-----
  
      $serwer = $loadservers['serverAddress'];
      $port="44405";
      $socket=@fsockopen($serwer,$port,$errno,$errstr,2);
  
      if($socket==true)
      {
       echo "&lt;p&gt;online&lt;/p&gt;";
      }else{
       echo "&lt;p&gt;offline&lt;/p&gt;";
      }
      echo '&lt;/td&gt;';
  
  //------- here is being loaded rest of info of the each server-----
  echo "&lt;td&gt;&lt;p&gt;" .$loadservers['serverName']."&lt;/p&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;p&gt;". '&lt;a href="' .$loadservers['serverAddress'].'"target="_blank"&gt;&lt;p&gt;'.$loadservers['serverAddress']. "&lt;/p&gt;&lt;/a&gt;". "&lt;/td&gt;";
  echo "&lt;td&gt;&lt;p&gt;" .$loadservers['serverExp']. "&lt;/p&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;p&gt;" .$loadservers['serverDrop']. "&lt;/p&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;p&gt;" .$loadservers['info']. "&lt;/p&gt;&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
  
  mysql_close();
  ?&gt;
  </code></pre>