daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Apr 27th, 2016 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $FuserName = $_POST["userName"];
  4. $Fpassword = $_POST["password"];
  5. $username = 'ADMIN';
  6. $pass = 'ADMIN';
  7. $db = "pym";
  8.  
  9. $link = mysqli_connect("localhost", $username, $pass);
  10. if (!$link) {
  11.     die("Could not connect: " . mysqli_connect_error());
  12. }
  13. echo "Connected successfully";
  14.  
  15. $db_selected = mysqli_select_db($link, "pym");
  16. if (!$db_selected) {
  17.     die ("Can't use pym : " . mysqli_connect_error());
  18. }
  19. echo "<br>Selected successfully";
  20. $user = mysqli_fetch_array(mysqli_query($link, "SELECT * FROM `users` WHERE `UserName` = '$FuserName'"));
  21. if($user == 0)
  22. {
  23.     die("Wrong username or password. please <a href='login.html'>try again</a>");
  24. }
  25. if($user['UserPassword'] != $Fpassword)
  26. {
  27.     die("Wrong usernmae or password. please <a href='login.html'>try again</a>");
  28. }
  29.  
  30. echo "Logged in successfully<br>";
  31. mysqli_close($link);
  32. echo "<a href = 'mainConnectedPage.html'>CLICK HERE TO CONTINUE</a>"
  33.  
  34. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top