forked from prakharsingh1312/cusiege
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.php
More file actions
34 lines (33 loc) · 759 Bytes
/
Copy pathcheck.php
File metadata and controls
34 lines (33 loc) · 759 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
<?php
session_start();
if(!isset($_SESSION['username']))
header('location:index');
elseif($_SERVER['REQUEST_METHOD']=="POST")
{
$score=0;
$tie=0;
$normal=0;
$table=$_SESSION['table'];
$user=$_SESSION['username'];
for($i=1;$i<=$_SESSION['numq'];$i++)
{
if($_SESSION['gans'][$i]==$_SESSION['cans'][$i])
{
$score++;
if($_SESSION['tie'][$i]==1)
$tie++;
else
$normal++;
}
}
include('Assets/php/dbconfig.php');
date_default_timezone_set("Asia/Kolkata");
$time=strtotime(date("M d Y H:i:s"))-strtotime($_SESSION['stime']);
$lol=mysqli_query($dbconfig,"UPDATE res_$table SET score=$score,tie=$tie,normal=$normal,time=$time WHERE username='$user'");
if($lol)
{
$_SESSION['check']=1;
header('location:finish');
}
}
?>