Verify form field with isset()
<p>Having issues with verifying that my form fields are not empty. I thought I used isset in the past but I am having issues with it below. I know I can do it with =="" but want to figure it out this way.</p>

<pre><code>if(isset($_POST['submit'])){
$error= false;
 if (isset($_POST['name'])){$name=$_POST['name'];}else{$error=true; $error_message="enter a name"; echo "no name";};

     if(!$error){
                //SUBMIT TO DATABASE
      }else{  echo $error_message;
      }

}
</code></pre>

<p>But I keep getting the error that error_message is not set. </p>
