Guest User

Untitled

a guest
Nov 24th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <?php
  2. $server_host = "mysql-omarsdajani.alwaysdata.net";
  3. $server_username = "141592";
  4. $server_password = "ben10ben10";
  5. $server_dbName = "omarsdajani_hustlehut";
  6.  
  7. $player_email = $_POST ["emailPost"];
  8. $player_password = $_POST ["passwordPost"];
  9.  
  10. $conn = mysqli_connect ($server_host, $server_username, $server_password, $server_dbName);
  11.  
  12. if (!$conn) {
  13. echo ("Could not connect to the server.");
  14. }
  15.  
  16. $findPlayer = mysqli_query ($conn, "SELECT * FROM Users WHERE Email = '$player_email'");
  17.  
  18. if (mysqli_num_rows ($findPlayer) > 0) {
  19. while ($row = mysqli_fetch_assoc ($findPlayer)) {
  20. if (password_verify ($player_password, $row['Password'])) {
  21. echo ("Signed in");
  22. echo ("|ID:" . $row['ID'] . "|Email:" . $row['Email'] . "|Username:" . $row['Username'] . "|Name:" . $row['Name'] . "|Date Registered:"
  23. . $row['Date_Registered'] . "|Goal:" . $row['Goal'] . "|System:" . $row ['System'] . "|Starting BFP:" . $row ['Starting_BFP'] .
  24. "|Starting Weight:" . $row ['Starting_Weight'] . "|Cal Goal:" . $row ['Cal_Goal'] . "|Carb Goal:" . $row ['Carb_Goal'] .
  25. "|Protein Goal:" . $row ['Protein_Goal'] . "|Fat Goal:" . $row ['Fat_Goal'] . "|Current Carbs:" . $row ['Current_Carb'] .
  26. "|Current Protein:" . $row ['Current_Protein'] . "|Current Fat:" . $row ['Current_Fat'] . "|Current Cals:" . $row ['Current_Cals']
  27. . "|Current BFP:" . $row ['Current_BFP'] . "|Current Weight:" . $row ['Current_Weight']);
  28. } else {
  29. echo ("Incorrect password");
  30. }
  31. }
  32. } else {
  33. echo ("Incorrect email");
  34. }
Add Comment
Please, Sign In to add comment