Advertisement
Guest User

Account Info Panel (Supporting PHP)

a guest
Sep 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php
  2.  
  3.     $server_host = "localhost";
  4.     $server_username = "monstahhh";
  5.     $server_password = "";
  6.     $server_db = "monstahhh";
  7.  
  8.     $conn = new mysqli($server_host, $server_username, $server_password, $server_db;
  9.  
  10.     if (!$conn)
  11.     {
  12.         echo "Could not connect to Database.";
  13.     } else
  14.     {
  15.        
  16.         $userIDPost = mysqli_real_escape_string($conn, $_POST['userIDPost']);
  17.         $hashPost = mysqli_real_escape_string($conn, $_POST['hashPost']);
  18.        
  19.         $key = "grgorogkrogkorkg";
  20.         $kys = $userIDPost . $key;
  21.         $hash = hash("sha512", $kys);
  22.        
  23.         if ($hashPost == $hash)
  24.         {
  25.             $selectSQL = "SELECT * FROM scores WHERE uniqueID='".$userIDPost."'";
  26.             $selectResult = mysqli_query($conn, $selectSQL);
  27.            
  28.             while($row = mysqli_fetch_assoc($selectResult))
  29.             {
  30.                 echo $row['name'] . "," . $row['score'];
  31.             } else
  32.             {
  33.                 echo "Failed to find row. Please report this to Sigma Studios.";
  34.             }
  35.         } else
  36.         {
  37.             echo "Hash Not Valid.";
  38.         }
  39.     }
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement