Get the URL of current script even if it's included?
<p>I have a PHP script that needs to know it's URL, even if it's included within another script.  I've tried:</p>

<pre><code>$_SERVER['REQUEST_URI']
</code></pre>

<p>But this doesn't return the URI to my script--rather, it returns the URI to the <em>including</em> script.  I've also tried:</p>

<pre><code>dirname ( __FILE__ )
</code></pre>

<p>But I can't seem to convert this to an absolute URL.</p>

<p>Can my script find its own URL, even if it's being included in another script?  Thanks for your help!</p>
