Guest User

Untitled

a guest
Nov 13th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. <div ng-app ng-init="checked = false">
  2. <form class="form-signin inventario" action="login2.php" method="post" name="form">
  3. <label for="username">Usuario</label>
  4. <input class="form-styling" type="text" name="username" id="user" placeholder="Type here"/>
  5. <label for="password">Contraseña</label>
  6. <input class="form-styling" type="text" name="password" id="pass" placeholder="Type here"/>
  7. <div class="btn-animate">
  8.  
  9. <button type="submit">Enviar</button>
  10. <a class="btn-signin" id="submit_text" type="submit"> Acceder</a>
  11. </div>
  12. </form>
  13. </div>
  14.  
  15. </div>
  16. $connect = mysqli_connect("localhost", "user", "pass", "dbname");
  17.  
  18. $username = $_GET['user'];
  19. $password = $_GET['pass'];
  20.  
  21. $sql1 = "SELECT * from usuarios WHERE user like '%".$_POST["1user"]."%'";
  22. $sql2 = "SELECT * from usuarios WHERE pass like '%".$_POST["2user"]."%'"; //search
  23. $result1 = mysqli_query($connect, $sql1);
  24. $result2 = mysqli_query($connect, $sql2);
  25.  
  26. if ($username == $result1 && $password == $result2)
  27. {
  28. echo "<script>"."window.alert('VALID USER')"."</script>";
  29. echo "<script>"."window.location.href='/milocalpage.html'"."</script>";
  30. }
  31. else
  32. {
  33. echo "INVALID USER, Go Back, EERROORR";
  34. }
  35.  
  36. /*
  37. if(mysqli_num_rows($result) > 0)
  38. {
  39. while($row = mysqli_fetch_array($result))
  40. {
  41.  
  42. }
  43.  
  44. }
  45. else
  46. {
  47. echo "Account Not Found";
  48. }
  49. */
  50. </div>
Add Comment
Please, Sign In to add comment