Online Attendance System
Online Attendance System
Code
<?php
// Initialize the session
session_start();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Online Attendance System</title>
</head>
<body>
<h2>Mark Your Attendance</h2>
Attendance Status:
<input type="radio" name="status" value="Present" required> Present
<input type="radio" name="status" value="Absent" required> Absent<br><br>
</body>
</html>
<?php
// Start the session
session_start();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Attendance Confirmation</title>
</head>
<body>
<h2>Attendance Marked</h2>
<p>Your attendance has been recorded as:</p>
<p><strong>Name:</strong> <?php echo $attendance['name']; ?></p>
<p><strong>Date:</strong> <?php echo $attendance['date']; ?></p>
<p><strong>Status:</strong> <?php echo $attendance['status']; ?></p>
</body>
</html>
Output
Before (attendance.php):
After (attendance_records.txt):