I have a loginin page login.php. When user clicks submit button it goes to another page loginprocess.php and checks whether user is valid or not. if user is valid then it again displays the same form and layout as the login.php page but with a message "Incorrect username and password" in a p element with class="errmsg" which is within the form below the form heading. So how do i edit the p element to display the error message ?
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
|
You can use
|
|||
|
I guess you can use jquery to append text to a div but this only works when you do the checking in the same page. You could also try to send a true/false value back to login.php and then use jquery to append text to the div or just echo the error with php. |
|||
|
Redirect user from loginprocess.php to loginprocess.php by appending a error flag at the end of the URL.
In loginprocess.php write below code before rendering tag :
|
|||
|