-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayersuche.php
More file actions
52 lines (44 loc) · 1.34 KB
/
Copy pathplayersuche.php
File metadata and controls
52 lines (44 loc) · 1.34 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
session_start();
include 'dbh.php';
$suchinput = mysqli_real_escape_string($conn, $_GET['suchanfrage']);
$sql1 = "SELECT * FROM profile WHERE uid='$suchinput'";
$result1 = mysqli_query($conn, $sql1);
if (!$row1 = mysqli_fetch_assoc($result1)){
$_SESSION['suchanfrage_ergebnis'] = false;
$_SESSION['suche_eingabe'] = $suchinput;
}
else{
$_SESSION['suche_id'] = $row1['id'];
$_SESSION['suche_username'] = $row1['uid'];
$_SESSION['suche_level'] = $row1['lvl'];
$_SESSION['suche_score'] = $row1['score'];
$_SESSION['suche_avatar'] = $row1['avatar'];
$_SESSION['suche_xp'] = $row1['xp'];
$_SESSION['suchanfrage_ergebnis'] = true;
if ($row1['score'] >= 50){
$update = "UPDATE profile
SET ach_1=1
WHERE uid='$suchinput';";
mysqli_query($conn, $update);
}
if ($row1['score'] >= 100){
$update = "UPDATE profile
SET ach_1=1, ach_2=1
WHERE uid='$suchinput';";
mysqli_query($conn, $update);
}
if ($row1['score'] >= 150){
$update = "UPDATE profile
SET ach_1=1, ach_2=1, ach_3=1
WHERE uid='$suchinput';";
mysqli_query($conn, $update);
}
$_SESSION['suche_ach_1'] = $row1['ach_1'];
$_SESSION['suche_ach_2'] = $row1['ach_2'];
$_SESSION['suche_ach_3'] = $row1['ach_3'];
$_SESSION['suche_ach_4'] = $row1['ach_4'];
$_SESSION['suche_ach_5'] = $row1['ach_5'];
$_SESSION['suche_ach_6'] = $row1['ach_6'];
}
header("Location: player.php");