I have a contact form that has a hidden field (profession). I am trying to check the script to make sure that this hidden field is empty, and if so, send me the result of the form. If this field is NOT empty, the form will not be sent to me.
Initially, my code was:
if(isset($_POST['profession']) && $_POST['profession'] == ''){
But I believe that this is really wrong and makes the profession field empty? Therefore, I believe that the code should be simple:
if(!isset($_POST['profession'])){
I got it right. What would be the best way to code this?
source share