Why am I getting a undefined variable error?
<p>I have a class member in PHP that looks like this:</p>

<pre><code>function hidden($defaultSort=""){
    $defaultSort = 'a';?&gt;
    &lt;input type="hidden" name="sort" id="&lt;?php print $this-&gt;id;?&gt;sort" value='&lt;?php print $defaultSort; ?&gt;' /&gt;
    &lt;?php print $defaultSort;
}
</code></pre>

<p>When I call this function I get the following source in firefox</p>

<pre><code>&lt;input type="hidden" value="&amp;lt;br /&amp;gt;&amp;lt;b&amp;gt;Notice&amp;lt;/b&amp;gt;:  Undefined variable: defaultSort in &amp;lt;b&amp;gt;/www/sptdev/htdocs/includes/v7/sptSearchBox.php&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;24&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;" id="searchFormSearchsort" name="sort"/&gt;a
</code></pre>

<p>Any ideas why I am getting the Undefined variable error?</p>

<p><strong>More details:</strong>
The line 24 that the error is coming from is the line with the hidden input.</p>

<p>I have discovered that this works as expected in IE8.</p>

<pre><code>&lt;input type="hidden" name="sort" id="searchFormSearchsort" value='a' /&gt;a
</code></pre>

<p>This doesn't make much sense to me since PHP is server side and this should have nothing to do with the browser.</p>

<p><strong>UPDATE</strong> -
The problem seems to be that I was highlighting and selecting "View Selection Source" in Firefox. When I just use "View Page Source" it looks fine.</p>
