Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysqli_connect("localhost","root","(my database password)","Test");
- if(isset($_POST['login'])){
- $username=mysqli_real_escape_string($con,$_POST['username']);
- $password=mysqli_real_escape_string($con,$_POST['password']);
- $select_user="SELECT * FROM Test WHERE 'Username' = '$username' AND 'Password' = '$password'";
- $run_user=mysqli_query($con,$select_user);
- $check_user=mysqli_num_rows($run_user);
- if($check_user>0){
- header('location:Home.php');
- }
- else{
- echo "Please enter your login information.";
- }
- }
- ?>
- <html>
- <head>
- </head>
- <body>
- <form action="" method="POST">
- <input type="text" name = "username" placeholder="Username"/>
- <input type="text" name = "password" placeholder="Password"/>
- <input type = "submit" value = "Login" name="login"/>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment