Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $server_host = "localhost";
- $server_username = "monstahhh";
- $server_password = "";
- $server_db = "monstahhh";
- $conn = new mysqli($server_host, $server_username, $server_password, $server_db;
- if (!$conn)
- {
- echo "Could not connect to Database.";
- } else
- {
- $userIDPost = mysqli_real_escape_string($conn, $_POST['userIDPost']);
- $hashPost = mysqli_real_escape_string($conn, $_POST['hashPost']);
- $key = "grgorogkrogkorkg";
- $kys = $userIDPost . $key;
- $hash = hash("sha512", $kys);
- if ($hashPost == $hash)
- {
- $selectSQL = "SELECT * FROM scores WHERE uniqueID='".$userIDPost."'";
- $selectResult = mysqli_query($conn, $selectSQL);
- while($row = mysqli_fetch_assoc($selectResult))
- {
- echo $row['name'] . "," . $row['score'];
- } else
- {
- echo "Failed to find row. Please report this to Sigma Studios.";
- }
- } else
- {
- echo "Hash Not Valid.";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement