Determining the complete URL but without the script name?
<p>Basically I'm trying to determine the complete web-accessible URL of a certain script, but without the script name.</p>

<p>For example, I was thinking of something along these lines:</p>

<pre><code>$fullURL = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
echo $fullURL;
</code></pre>

<p>So if the file was <code>http://example.com/path/to/file.php</code>, then that's what it would display: <code>http://example.com/path/to/file.php</code>. However, I want it to display <code>http://example.com/path/to/</code></p>

<p>Is this possible, and if so, how?</p>
