Consider you have a login form having username, password fields, login and cancel buttons. Now, write a PHP program for implementing login event. The login should be redirected to home.php upon successful login button event. The cancel button should clear the form field values upon its submission.
Consider you have a login form having username, password fields, login and cancel buttons. Now, write a PHP program for implementing login event. The login should be redirected to home.php upon successful login button event. The cancel button should clear the form field values upon its submission.[10]
Both buttons are submit buttons inside the same form, and each carries its own name. A browser posts only the button that was actually pressed, so the script can ask isset($POST['login']) or isset($POST['cancel']) and know which event it is handling. That is the whole mechanism: PHP has no client...