PHP Undefined variable in Apache error_log
<p>I'm getting a series of:</p>

<p>"Undefined variable: loginError in /Library/WebServer/Documents/clients  . . ."</p>

<p>entries in my Apache error_log which I would like to prevent. I have a simple login.php page which, if there's an error logging in sets the $loginError variable as such:</p>

<pre><code>$loginError = '&lt;p class="text-error"&gt;Login Error: '. $layouts-&gt;getMessage(). ' (' . $layouts-&gt;code . ')&lt;/p&gt;';
</code></pre>

<p>If there's no error logging in it does this:</p>

<pre><code>$loginError = '';
</code></pre>

<p>I then output any errors as such:</p>

<pre><code>if ($loginError !== '') { //line 112
echo $loginError; /line 113
} 
</code></pre>

<p>I'm getting the entries for the line 112 and 113 noted in my comments above. Anyone tell me how I can prevent the entries appearing? I'm using PHP Version 5.3.6.</p>

<p>thanks</p>
