title: fsockopen() not working on a specific web host?
body: <p>One of our customers said they have a very simple script which uses fsockopen() to determine whether a server is online or not. They said until recently it worked fine on their website through us, but recently just stopped working, so I am assuming it is a setting.</p>
  
  <p>My first thought was that he was using it as TCP and using the IP/Port for a Game Server, however he and myself both confirmed the script worked fine from various other web hosts.</p>
  
  <p>What could be the issue on ours in particular?</p>
  
  <p>Works: <a href="http://crazygfl.xfactorservers.com/query.php?ip=www.xfactorservers.com&amp;port=80" rel="nofollow">http://crazygfl.xfactorservers.com/query.php?ip=www.xfactorservers.com&amp;port=80</a></p>
  
  <p>Works: <a href="http://crazygfl-stats.com/query.php?ip=109.73.163.231&amp;port=27015" rel="nofollow">http://crazygfl-stats.com/query.php?ip=109.73.163.231&amp;port=27015</a></p>
  
  <p>Doesn't Work: <a href="http://crazygfl.xfactorservers.com/query.php?ip=109.73.163.231&amp;port=27015" rel="nofollow">http://crazygfl.xfactorservers.com/query.php?ip=109.73.163.231&amp;port=27015</a></p>
  
  <p>Here is the code...</p>
  
  <pre><code>&lt;?php
  
      $timeout = (isset($_GET['timeout']) ? ($_GET['timeout'] &lt;= 0 ? 30 : ((int)$_GET['timeout'])) : 30);
  
      if(empty($_GET['ip'])&amp;&amp;empty($_GET['port'])){
          echo 'No IP/Port specified.';
      }else{
          if(fsockopen($_GET['ip'], $_GET['port'], $errno, $errstr, $timeout) === false){
              echo 'offline';
          }else{
              echo 'online';
          }
      }
  </code></pre>