-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogout_page.php
64 lines (50 loc) · 1.25 KB
/
Logout_page.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
<!-- logout page and examination details are stored in database(history table) -->
<?php
session_start();
//echo "<h1 >Exam is completed</h1>";
//remove all session variables
//session_unset();
//destroy the session
//session_destroy();
?>
<?php
include_once "db_connection.php";
//conn is connection with databse "ExaminationDB"
?>
<?php
// set the expiration date to one hour ago
setcookie("roll_no", "", time() - 60);
?>
<html>
<body style="background-color: lightblue">
<p style="text-align: center;"><h2>Thanks for taking Exam</h2></p>
<?php
$date = date('Y-m-d H:i:s');
$name=$_SESSION['name'];
$ph_no=$_SESSION['ph_no'];
$Rollno=$_SESSION['roll_no'];
$branch=$_SESSION['branch'];
$email=$_SESSION['email'];
//echo $email;
$count=$_SESSION['correct_count'];
$sql="INSERT INTO history VALUES ('$name','$Rollno','$ph_no','$branch','$email',$count ,'$date')";
$result = $conn->query($sql);
if (!$result)
{
trigger_error('Invalid query: ' . $conn->error);
}
?>
<?php
//session_start();
//echo "Exam is completed";
//remove all session variables
session_unset();
//destroy the session
session_destroy();
?>
<br>
<form action="Login_page.php">
<input type="submit" value="Home Page">
</form>
</body>
</html>