-
Notifications
You must be signed in to change notification settings - Fork 0
/
UbGFTXOaR7HR08B.php
37 lines (35 loc) · 1.11 KB
/
UbGFTXOaR7HR08B.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
session_start();
if(!isset($_SESSION['uid']) && isset($_POST['SNEzrIZfziJ9DSb'])){
header("location: index.php");
} else {
/*
Database configuration
Modify as per database
*/
$servername = "";
$username = "";
$password = "";
$db_name = "";
$fresh = $_POST['SNEzrIZfziJ9DSb'];
$_SESSION['score'] = $fresh;
$name = $_SESSION['fname'];
$lname = $_SESSION['lname'];
$uid = $_SESSION['uid'];
$conn = mysqli_connect($servername, $username, $password, $db_name);
$damn = "SELECT * FROM scores where uid='$uid'";
$res = mysqli_query($conn, $damn);
if($res->num_rows>0){
$upper = mysqli_fetch_assoc($res);
if($upper["score"] < $fresh){
$update_query="UPDATE scores SET score = $fresh WHERE uid='$uid'";
mysqli_query($conn, $update_query);
}
} else {
$query_pop = "INSERT INTO scores (uid, name, lname, score) VALUES ('$uid', '$name', '$lname', $fresh)";
mysqli_query($conn, $query_pop);
}
mysqli_close($conn);
header("location: flappypoop.php");
}
?>