Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Login</title>
- </head>
- <body>
- <center><?php include 'config.php'; ?>
- <form method="POST" action="Login.php">
- Username: <input type="text" name="user" value = "Username" /><br/>
- Password: <input type="text" name="pass" value = "Password" /><br/>
- <br/>
- <input type="submit" name="Login" />
- </form></div>
- <?php
- if(isset($_POST["user"]) && isset($_POST["pass"])){
- $user = $_POST["user"];
- $pass = $_POST["pass"];
- $user = stripslashes($user);
- $pass = stripslashes($pass);
- $user = mysql_real_escape_string($user);
- $pass = mysql_real_escape_string($pass);
- $result = mysql_query(" SELECT * FROM Users WHERE username ='$user' AND password ='$pass'");
- $success=mysql_num_rows($result);
- if($success == 0){
- echo "Username/Password doesn't exist";
- }
- else{
- echo "You've successfully logged in as $user";
- }
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment