Jump to content
Larry Ullman's Book Forums

Recommended Posts

I am assuming that: if (!empty($_POST[‘password’])) is NOT equal to if ($_POST[‘password’]) because the first is true only when something is written for password, while the later is true when password is posted even if it was blank. Pls. confirm if my understanding is correct or explain otherwise.

Link to comment
Share on other sites

Yes, that's correct. Text inputs and textareas without any values would pass an if ($var) test but would not pass if (!empty($var)). That being said, if (isset($var)) is better than just if ($var), as the latter will trigger notices if the variable is not set.

Link to comment
Share on other sites

 Share

×
×
  • Create New...