This is for php 7+
$fromPerson = $_POST['fromPerson']??''; if($fromPerson) { //$_POST['fromPerson'] exists and not empty } else { // =( }