forked from prakharsingh1312/cusiege
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreq.php
More file actions
43 lines (36 loc) · 847 Bytes
/
Copy pathreq.php
File metadata and controls
43 lines (36 loc) · 847 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
38
39
40
41
42
43
<?php
session_start();
if(!isset($_SESSION['username']))
header('location:index');
elseif($_SERVER['REQUEST_METHOD']=="POST")
{
$table=$_SESSION['table'];
$user=$_SESSION['username'];
$team=$_SESSION['team'];
$q=$_SESSION['i'];
include('Assets/php/dbconfig.php');
include('pre.php');
if($_SESSION['done'][$q]==1)
{
$_SESSION['lul']=1;
unset($_SESSION['i']);
header('location:play');
}
else{
$query="SELECT username FROM check_req WHERE username='$user'";
$result=mysqli_query($dbconfig,$query);
$row=mysqli_fetch_array($result,MYSQLI_ASSOC);
if(mysqli_num_rows($result)!=0)
{
$_SESSION['cr2']=1;
header('location:play');
}
else{
$lol=mysqli_query($dbconfig,"INSERT INTO check_req (username,teamname,questionid) VALUES('$user','$team',$q)");
if($lol)
{
$_SESSION['cr']=1;
header('location:finish');
}}
}}
?>