-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.php
More file actions
40 lines (40 loc) · 797 Bytes
/
view.php
File metadata and controls
40 lines (40 loc) · 797 Bytes
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
<?php
if (isset($_POST['delete'])) {
file_put_contents("registrations.txt", "");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Registered Participants</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h2>Registered Participants</h2>
<?php
if (file_exists("registrations.txt")) {
$lines = file("registrations.txt");
if (count($lines) > 0) {
foreach ($lines as $line) {
if (trim($line) != "") {
echo "<div class='card'>$line</div>";
}
}
} else {
echo "<p>No registrations yet.</p>";
}
}
?>
<br>
<form method="POST">
<button type="submit" name="delete"
onclick="return confirm('Are you sure you want to delete all registrations?');">
Clear All Registrations
</button>
</form>
<br>
<a href="index1.php">Back to Registration</a>
</div>
</body>
</html>