Guest User

Untitled

a guest
Mar 8th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Test</test>
  5. </head>
  6. <body>
  7. <?php
  8.  
  9. $DatabaseName = "******";
  10. $ServerIP = "******";
  11. $UsernameDB = "*******";
  12. $PasswordDB = "*********";
  13.  
  14. $Connection = new mysqi($ServerIP, $UsernameDB, $PasswordDB, $DatabaseName);
  15.  
  16. if($Connection->connect_error)
  17. {
  18. die("Connection failed: ". $Connection->connect_erro);
  19. }
  20.  
  21. echo"Connected successfully";
  22.  
  23. if(isset($_POST["submit"]))
  24. {
  25. if(isset($_POST["Username"]) && isset($_POST["Password"]))
  26. {
  27. $UN = $_POST['Username'];
  28. $PW = $_POST['Password'];
  29.  
  30. $Query = "SELECT * FROM Login WHERE UserName='$UN' AND PassWord='PW'";
  31.  
  32. $result = $Connection->$Query;
  33.  
  34. $result->num_rows;
  35.  
  36. if(num_rows < 0)
  37. {
  38. echo"Invalid Creds";
  39. }
  40. else
  41. {
  42. echo"Welcome";
  43. }
  44. }
  45. }
  46. ?>
  47.  
  48. </body>
  49.  
  50. </html>
Add Comment
Please, Sign In to add comment