Silver Posted September 29, 2011 Share Posted September 29, 2011 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 More sharing options...
Larry Posted September 30, 2011 Share Posted September 30, 2011 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 More sharing options...
Recommended Posts