Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['login']))
- {
- $username=$_POST['username'];
- $password=$_POST['password'];
- $query= "select * from username WHERE username='$username' AND password='$password' ";
- $query_run = mysqli_query($con,$query);
- if(mysqli_num_rows($query_run)>0)
- {
- //valid
- $_SESSION['username']= $username;
- header('location:homepage.php');
- }
- else {
- //invalid
- echo '<script type="text/javascript"> alert ("Invalid credentials") </script>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement