Using $_GET on other pages
<p>I have a search file - dir/search.php</p>

<p>In search.php:</p>

<pre><code>&lt;script type="text/javascript" src="timeout.js"&gt;&lt;/script&gt;
</code></pre>

<p>In timeout.js:</p>

<pre><code>&lt;script src="functions.php"&gt;&lt;/script&gt;
</code></pre>

<p>In functions.php in one line I have:</p>

<pre><code>document.write('&lt;?php if (!isset($_GET["r"])) { echo "error"; } elseif ($_GET["r"] ==     "top") { ?&gt;&lt;title&gt;Top Results&lt;/title&gt;&lt;?php } ?&gt;');
</code></pre>

<p>I was wondering why when I looked at search.php?r=top, it would display "error"?</p>
