problem with fopen and fwrite
<p>hi when i execute this code nothing happen in browser but when i delete lines with star,the contents printed correctly,whats wrong??</p>

<p>/////////////////</p>

<pre><code>$documentroot=$_SERVER['DOCUMENT_ROOT'];
$handle=fopen("$documentroot/order/order.txt",'r+');

if(!$handle) {
  echo 'error opening file';
} 

$content="pepsi\ncola\npeperoni";
$write=fwrite($handle,$content); //*

if(!$write){ //*
  echo 'error writing'; //*
} //*

while(!feof($handle)) {
$string=fgets($handle);
echo $string;
}
</code></pre>
