Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['Submit'])){
- $db=mysqli_connect('localhost','root','','quiz_marcon');
- $username=$_POST['username'];
- $password=$_POST['password'];
- $sql= "SELECT * from users where username='$username' and password='$password'";
- $result=mysqli_query($db, $sql);
- if (mysqli_num_rows($result)== 0){
- echo '<script language="javascript">';
- echo 'alert("Incorrect Username or Password")';
- echo '</script>';
- }
- else{
- header("Location: display.php");
- }
- }
- ?>
- <html>
- <title>Login Page</title>
- <body>
- <form method = "post">
- <pre>
- Input Username: <input type ="text" name = "username"><br>
- Input Password: <input type ="password" name = "password"><br><input type="Submit" name="Submit" value="Submit">
- </pre>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement