-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.php
More file actions
54 lines (50 loc) · 1.87 KB
/
Copy pathaction.php
File metadata and controls
54 lines (50 loc) · 1.87 KB
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
<?php
$file = 'results.txt';
$name = $_POST["name"];
$institution = $_POST["institution"];
$difficulty = $_POST["difficulty"];
$howlong = $_POST["howlong"];
$device = $_POST["device"];
$comments = $_POST["comments"];
$timestamp = date("Y-m-d H:i:s",time());
$entry = $_SERVER['REMOTE_ADDR'].",".$_SERVER['HTTP_USER_AGENT'].",".$timestamp . "," . $difficulty . "," . $howlong . "," . $device . "," . $comments . "\n";
// Write the contents to the file,
// using the FILE_APPEND flag to append the content to the end of the file
// and the LOCK_EX flag to prevent anyone else writing to the file at the same time
file_put_contents($file, $entry, FILE_APPEND | LOCK_EX);
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CarpentriesOffline</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="Description" content="Online registration form, HTML, CSS, Mobile First">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<!--Header section-->
<header>
<h1>CarpentriesOffline</h1>
</header>
<main>
<section>
<h2>Hi there,</h2>
<p>
Thank you very much for helping us out. If you haven't done so yet, please also connect to our
other access point to do the same as you have done here.
</p>
</section>
<section>
<h3>Your resonses were:</h3>
<p>
<!--
Name: <?php echo htmlspecialchars($_POST['name']); ?>.</br>
Institution: <?php echo htmlspecialchars($_POST['institution']); ?>.</br>
-->
Difficulty: <?php echo (int) $_POST['difficulty']; ?>.</br>
How long: <?php echo htmlspecialchars($_POST['howlong']); ?>.</br>
Device: <?php echo htmlspecialchars($_POST['device']); ?>.</br>
Comments: <?php echo htmlspecialchars($comments); ?>.</p>
</section>