I am just trying to check if a form variable is empty. The code sets the variables $getsubject
and $getsubject
to the $_POST
of the form, then I am checking if they are, empty and if they are I want to set them to "No Message"
or "No Subject"
. I tried with isset
as well and it didn't work. I even tried setting an else statement that does the same thing and it doesn't change it.
$getsubject = $_POST['subject'];
$getmessage = $_POST['message'];
if(empty($getsubject)) {
$getsubject = "<No Subject>";
}
if(empty($getmessage)){
$getmessage = "<No Message>";
}