-
Notifications
You must be signed in to change notification settings - Fork 18
/
case.php
64 lines (38 loc) · 968 Bytes
/
case.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
session_start();
require_once("config.php");
$ac=$_POST['tu'];
$tc=$_POST['ta'];
$sc=$_POST['uc'];
$us=$_SESSION['un'];
$l=strlen($ac)-5;
$m=strlen($tc);
if($l==$m)
{
//echo("Accepted");
$result="Accepted";
}
else if($ac==$tc)
{
//echo("Accepted");
$result="Accepted";
}
else
{
/*echo($l);
var_dump($ac);
var_dump($tc);
echo("Wrong Answer ".$ac);*/
$result="Wrong Answer";
}
$sql="INSERT INTO submission VALUES('','$us', '$result') ";
$nsql="INSERT into code VALUES('us','$sc','')";
$show="SELECT * FROM submission";
$stq=mysqli_query($con,$sql);
$send=mysqli_query($con,$nsql);
$sts=mysqli_query($con,$show);
while($row=mysqli_fetch_array($sts))
{
echo "<div style=\"margin-left:300px; margin-right:200px; padding-left:200px;border-bottom:1px solid black;\"> <a href=\"showcode.php?id=$row[sid]&nm=$row[sname]\">$row[sid]</a>.......<a href=\"profile.php?user=$row[sname]\">$row[sname]</a>---------$row[verdict]</div>";
}
?>