Detecting Which Page is Referencing a PHP Generated JavaScript file
<p>I am generating a JS navigation using PHP.  Script is included like so</p>

<pre><code>&lt;script type='text/javascript' src='/topNav.js.php'&gt;&lt;/script&gt;
</code></pre>

<p>I would like to use PHP rather than JavaScript to assign the class for the current page's link but all of the $_SERVER vars see the topNav.js.php location.</p>

<p>I know I could use JS something  like</p>

<pre><code>if(window.location.href == 'myurl') {
    document.getElementById('itemx').className += 'active';
}
</code></pre>

<p>but I wanted to know if there was a good way to do this via PHP.</p>
