Check for empty field for my username and password
<pre><code>&lt;?php
if ( isset( $_GET['fail']) &amp;&amp; !empty($_POST["uname"]))
{
  echo '&lt;script language="javascript"&gt;';
  echo 'alert("Your name or password is incorrect")';
  echo '&lt;/script&gt;';
}
</code></pre>

<p>How do I check for empty field when I press the submit button?</p>