File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 3030 if (empty (trim ($ _POST ["password " ]))){
3131 $ password_err = "Please enter your password. " ;
3232 } else {
33- $ password = trim ( $ _POST ["password " ]) ;
33+ $ password = $ _POST ["password " ];
3434 }
3535
3636 // Validate credentials
3737 if (empty ($ username_err ) && empty ($ password_err )){
3838 // Prepare a select statement
39- $ sql = "SELECT id, username, password FROM users WHERE username = ? " ;
39+ $ sql = "SELECT id, username, password FROM users1 WHERE username = ? " ;
4040
4141 if ($ stmt = mysqli_prepare ($ link , $ sql )){
4242 // Bind variables to the prepared statement as parameters
5454 if (mysqli_stmt_num_rows ($ stmt ) == 1 ){
5555 // Bind result variables
5656 mysqli_stmt_bind_result ($ stmt , $ id , $ username , $ hashed_password );
57+
5758 if (mysqli_stmt_fetch ($ stmt )){
5859 if (password_verify ($ password , $ hashed_password )){
5960 // Password is correct, so start a new session
6869 header ("location: Welcomepage.php " );
6970 } else {
7071 // Password is not valid, display a generic error message
71- $ login_err = "Invalid username or password . " ;
72+ $ login_err = "Invalid username or password1 . " ;
7273 }
7374 }
7475 } else {
You can’t perform that action at this time.
0 commit comments