title: php header function prepending the current directory
body: <p>I am new to php and I faced this problem while redirecting to other php files. To make my question clear I created two php files. first.php and second.php.Both this files are found in /var/www/test/.
  This is the code in first.php</p>
  
  <pre><code>&lt;?php
  $url = "localhost/test/second.php";
  header("Location:$url");   ?&gt;
  </code></pre>
  
  <p>This is the code in second.php</p>
  
  <pre><code>&lt;?php
  echo("this is the second page"); ?&gt;
  </code></pre>
  
  <p>And when I browse to first.php file I got this in my Firefox browser.</p>
  
  <p><strong>The requested URL /test/localhost/test/second.php was not found on this server.</strong></p>
  
  <p><strong>test/</strong> is added to the header string, which is clear as you can see. Thank you.</p>