I am trying to pass some search criteria via a form.
I wanted to test each of the possible fields to see if they are set and then create a query around the info passed in from the form. I thought I could use is_null to test and find out is blank, but what I am getting is that is_null fails and isset returns true on a text field that is left blank.
How would it be best to test this?
Here is what I have now:
$city=$_POST['city'];
$set = isset($_POST['city']);
$null = is_null($_POST['city']);
echo "<h3>City=$city; isset = $set; and is_null = $null </h3>";
And where the city is left blank it returns:
City=; isset = 1; and is_null =