Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. This is the front end
  2. <section id="MiddlePart">
  3. <form >
  4.  
  5.  
  6. <b id="Login1"> Name </b>
  7. <input id="Login1" type="text" name="txtName" value="" /></br>
  8. <b id="Login2"> Password </b>
  9. <input id="Login2" type="password" name="txtPassword" value="" />
  10.  
  11. <input id="btnLogin" type="button" value="Login" />
  12. </form>
  13. <?php
  14. if (isset($_GET['btnLogin'])) {
  15.  
  16. $formUsername = $_GET['txtName'];
  17. $formPassword = $_GET['txtPassword'];
  18. $connObj->LoginValidation($formUsername, $formPassword);
  19.  
  20. if ($connObj->LoginValidation($formUsername, $formPassword)) {
  21. header('location:AdminPage.php');
  22.  
  23. }
  24. }
  25. ?>
  26. </section>
  27.  
  28. This is the function im recalling
  29.  
  30. function LoginValidation($user, $pass) {
  31.  
  32. $query = "SELECT * FROM `logintable` WHERE `username` ='$user' AND `password` = '$pass' ";
  33. $result = mysqli_query($this->link, $query);
  34. $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
  35. if (count($row) ==0)
  36. {
  37. return FALSE;
  38. }
  39. else {
  40. return TRUE;
  41. }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement