-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathton.php
More file actions
37 lines (24 loc) · 818 Bytes
/
Copy pathton.php
File metadata and controls
37 lines (24 loc) · 818 Bytes
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
include "newcon.php";
if (isset($_GET["accept"])){
$id=$_GET["accept"];
$conn = new mysqli('localhost','root','','user-verification');
$ps=$_SESSION['username'];
$sql = "SELECT * FROM legends WHERE player='$ps' LIMIT 1";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
echo "you are already registered";
}
else{
$stmt = $conn->prepare("INSERT into legends(player)values(?)") or die($conn->error);
$ps=$_SESSION['username'];
$stmt->bind_param("s",$ps);
$stmt->execute();
if($stmt->error){
echo "\r\nMYSQL Error: ", $stmt->error, "\r\n";}
header("location: index.php?tournamentregistration=sucess");
$stmt->close();
$conn->close();
}
}
?>