-
Notifications
You must be signed in to change notification settings - Fork 0
/
submit.php
49 lines (42 loc) · 1.27 KB
/
submit.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
<?php
session_start();
include "connection.php";
//$testNo=$_SESSION['testNo'];
$sql = "SELECT * FROM ";
$sql.=$_SESSION['domain'];
$sql.=" WHERE testNo = ";
$sql.=$_SESSION['testNo'];
$answer = mysqli_query($con,$sql);
$marks=0;
while($check=mysqli_fetch_assoc($answer))
{
$string="q_".$check['id'];
if(isset($_POST[$string]))
{
if($_POST[$string]==$check['answer'])
$marks++;
}
}
$store_sql="UPDATE apply2019 SET ";
$store_sql.=$_SESSION['domain']."_Score =";
$store_sql.=$marks." WHERE gr=".$_SESSION['grNo'];
$answer = mysqli_query($con,$store_sql);
session_destroy();
//echo "<script>alert('Your score is ".$marks.""."');</script>";
?>
<!doctype html>
<html>
<head>
<title>Submitted</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<div class="jumbotron text-xs-center">
<center>
<h1 class="display-3">Thank You!</h1><center>
<p class="lead"><strong>Your Response have been submited</strong> wait till further instructions .</p>
<hr>
<p class="lead">
<a class="btn btn-primary btn-sm" href="login.php" role="button">Continue to homepage</a>
</p>
</div>
</html>