I have a contact form which has a hidden field (profession). I am trying to get the script to check to make sure this hidden field IS empty and if so, then send the form result to me. If however this field is NOT empty, the form is not sent to me.
Orginially my code was:
if(isset($_POST['profession']) && $_POST['profession'] == ''){
But I believe this is actually incorrect and is forcing the profession field to be blank? So I believe the code should simply be:
if(!isset($_POST['profession'])){
Have I got this correct. Which would be the best way to code this?