Make this code better

Entry Form php html ERROR

Login system should display information when entered correct and "invalid" if enter incorrectly. I'm not sure what I have done wrong tried copying the code from a YouTube. I think its to do with the PHP part but not 100% sure.

Login.php
<html> <head> <title>Login Page</title> <body> <form action="login.php" method="post"> Enter your User ID / Name <input type="text" name="username"> <br> Enter your Password <input type="password" name="pass"> <br> <input type="submit" value="Login" name="submit"> </form> </body> </html> <?php if(isset($_POST['submit'])) { $user = $_POST['username']; $pass = $_POST['pass']; if(($user=="hari")&&($pass="cse")) { echo "Welcome Hari"; } else { echo "Invalid username/password"; } } ?>

Reactions 19 reactions

JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone
JCob Jacob Robinson commented on this code
0
Problem fixed thanks everyone

Comment on this code:

Please Login or Register to leave a comment.