Weird PHP problem
<p>I have the following code...</p>

<pre><code>&lt;?php
  session_start();
  require_once('myDB.php');
  if (isset($_POST))
  {
     foreach($GLOBALS['myDB']-&gt;getShops()as $i)
     {
       $tempLat = $i['latitude'];
       $templong  = $i['longitude'];
       $distance = distance($_POST['latitude'],$_POST['longitude'],$tempLat,$templong);
       if($distance &lt;= 300)
       {
          echo "".$i['id']."|".$i['shopName']."|".$i['longitude']."|".$i['latitude']."|".$i['advert']."|";
       }      
     }
  }
  function distance($lat1, $lon1, $lat2, $lon2) {
  $theta = $lon1 - $lon2;
  $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
  $dist = acos($dist);
  $dist = rad2deg($dist);
  $miles = $dist * 60 * 1.1515;
  return (($miles * 1.609344)*1000);
 }
?&gt;
</code></pre>

<hr>

<p>Now when I get to see that page it gives me Error 324 (net::ERR_EMPTY_RESPONSE) and it says that the website may be temporarily down...If i try to open the page using firefox it opens a dialog for downloading the php file...</p>

<p>What I would like to do is to have it print either the echoes (if distance is in fact bigger than 300 meters) or nothing at all but it should still be an empty html page...</p>

<p>Can anyone see whats wrong with that???</p>

<p>NOTE: The code works fine locally but not on my server..however every other page works as expected so the server is up and running...</p>
