Advertisement
Guest User

Untitled

a guest
Jan 4th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2. //include init.php
  3. include ("session.php");
  4. //Gather details submitted from the $_POST arrayand store in local vars
  5. $username=$_POST["txtUser"];
  6. $password=$_POST["txtPass"];
  7. $sublogin=$_POST["subLogin"];
  8.  
  9. //build query to SELECT records fro the users table WHERE the username AND password in the table are equal to those entered
  10. $sql="Select * from userbook Where UserName = '$username' and Password='$password'";
  11.  
  12. //run query and store result
  13. $result=$conn->query($sql);
  14.  
  15. //check result and generate message with code below
  16. if ($row = mysqli_fetch_assoc($result))
  17. {
  18. echo "you are recognised";
  19. }
  20. else
  21. {
  22. echo "you are not recognised";
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement