title: Unable to open a file from PHP using fopen
body: <p>i am trying to read contents from a text file in php. i am using wamp on windows. i m getting this error:</p>
  
  <p>Warning: fopen(/input.txt): failed to open stream: No such file or directory in C:\wamp\www\cycle_gps_sender.php on line 3   </p>
  
  <p>this is my code:</p>
  
  <pre><code>$location = fopen("/input.txt", "r") or die("Unable to open file!");
  echo $location;
  fclose($location);
  </code></pre>
  
  <p>both the php file and input.txt are placed in www folder of wamp.</p>