-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.php
55 lines (42 loc) · 1.12 KB
/
Test.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
<html>
<head>
<title>Test Destination</title>
<style>
.center{
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
</head>
<body>
<body>
<img src = "img/bongocat.gif" width="540" class="center">
<?php
// prevent direct access
if ($_SERVER['HTTP_REFERER'] == "http://127.0.0.1/CS3235/login.php") {
// continue checking
} else {
header("Location: http://127.0.0.1/CS3235/login.php");
exit(); //Stop running the script
// go to form page again.
}
echo "<script>alert('Successfully logged in');</script>";
session_start();
echo $_SESSION['bssid'];
echo "<br>";
echo $_SESSION['ssid'];
// once bssid and ssid is processed, delete it from session so it cannot not be
// reused
session_destroy();
// time test - change device time and see if it is reflected here
echo "<br>";
date_default_timezone_set('Asia/Singapore');
$timestamp = time();
$date_time = date("d-m-Y (D) H:i:s", $timestamp);
echo "Current date and local time on this server is $date_time";
?>
</body>
</body>
</html>