开发者

On page load for chrome, ie, ff triggers form validation error message in PHP

开发者 https://www.devze.com 2023-01-08 09:49 出处:网络
if($username==\"\") { $login_domain_error=\"Enter User Name\"; } if(isset($_POST[\'passwd\'])) { $login_p_error=\"Enter Pa开发者_如何学JAVAssword\";

if($username=="") { $login_domain_error="Enter User Name"; }

if(isset($_POST['passwd'])) {
    $login_p_error="Enter Pa开发者_如何学JAVAssword";

When I enter the above two validation, it triggers the validation errors, without form submission using PHP

What exactly is wrong

Thanks Jean


Well, you're checking if $_POST['passwd'] is set, and if that's the case, you define an error.


What's your error message?

Anyway, you should change if(isset($_POST['passwd'])) { to if(empty($_POST['passwd'])) { and add a } to that.

0

精彩评论

暂无评论...
验证码 换一张
取 消