Hey i got a problem that might be easily solved, but i can’t seem to find anything on it.
I have a form:
<form action="<?php echo $_SERVER['self']; ?>" method="post">
First Name: <input name="firstnamepass" type="text" size="35" /><br />
Surname: <input name="surnamepass" type="text" size="35" /><br />
Email: <input name="emailpass" type="text" size="35" /><br />
<input type="submit" value="Search Member" />
Now i have PHP getting the post data:
if(isset($_POST['firstnamepass']))
echo "surname is set <br />";
if(isset($_POST['surnamepass']))
echo "surname is set <br />";
if(isset($_POST['emailpass']))
echo "email is set <br />";
Problem is, everything seems to be set even if i haven’t set a value for it. Any ideas? Any way around it?
thanks for the help.
Use empty function instead – http://php.net/manual/en/function.empty.php