title: Script returns offline for every ping
body: <p>I have the script below, and it can ping any IP statically put in the file, but when I post to it it always fails.</p>
  
  <pre><code>&lt;?php
  $server = $_POST['ip'];
  if (!$socket = @fsockopen("$server", 80, $errno, $errstr))
  {
    echo "&lt;font color='red'&gt;&lt;strong&gt;Offline!&lt;/strong&gt;&lt;/font&gt;";
  }
  else 
  {
    echo "&lt;font color='green'&gt;&lt;strong&gt;Online!/strong&gt;&lt;/font&gt;";
  
  
    fclose($socket);
  }
  
  ?&gt;
  </code></pre>