The elders help me to see where the following code is wrong. Why can't I prompt that the user name or password cannot be blank when I have not entered the user name or password ???
Enter the user name or password
If (isset ($ _ POST ['submit ']) & $ _ POST ['submit'] = "logon "){
$ User = $ _ POST ['user'];
$ Pass = $ _ POST ['pass'];
If (empty ($ user) | empty ($ pass )){
Echo" Alert ('user name or password cannot be blank '); ";
}
}
?>
Reply to discussion (solution)
Echo" Alert ('user name or password cannot be blank '); ";
Wrong
It should be script or script.
Metho is not written,
If you do not submit a post object, you cannot pass $ _ POST verification.
If (isset ($ _ POST ['submit ']) & $ _ POST ['submit'] = "logon "){
$ User = $ _ POST ['user'];
$ Pass = $ _ POST ['pass'];
If (empty ($ user) | empty ($ pass )){
Echo "script" alert ('user name or password cannot be blank '); script ";
}
}
?>