Create a form to accept patient details like name, address, birthdate, and mobile
number. Once the Patient information is accepted, and then accepts health details like
medicare number, health fund and critical information. Display patient details and health
details on the next form.
//patient.php
<!DOCTYPE html>
<html>
<head>
<title>Patient Details</title>
</head>
<body>
<h2>Enter Patient Details</h2>
<form method="post" action="health.php">
Name: <input type="text" name="name" required><br><br>
Address: <input type="text" name="address" required><br><br>
Birthdate: <input type="date" name="birthdate" required><br><br>
Mobile Number: <input type="text" name="mobile" required><br><br>
<input type="submit" value="Next">
</form>
</body>
</html>
//health.php
<?php
// Receive patient details from previous form
$patientName = $_POST['name'];
$patientAddress = $_POST['address'];
$patientBirthdate = $_POST['birthdate'];
$patientMobile = $_POST['mobile'];
?>
<!DOCTYPE html>
<html>
<head>
<title>Health Details</title>
</head>
<body>
<h2>Enter Health Details for <?php echo htmlspecialchars($patientName); ?></h2>
<form method="post" action="display.php">
<!-- Hidden fields to pass patient info -->
<input type="hidden" name="name" value="<?php echo htmlspecialchars($patientName); ?>">
<input type="hidden" name="address" value="<?php echo htmlspecialchars($patientAddress); ?>">
<input type="hidden" name="birthdate" value="<?php echo htmlspecialchars($patientBirthdate); ?>">
<input type="hidden" name="mobile" value="<?php echo htmlspecialchars($patientMobile); ?>">
Medicare Number: <input type="text" name="medicare" required><br><br>
Health Fund: <input type="text" name="healthfund" required><br><br>
Critical Information: <textarea name="critical" required></textarea><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
//display.php
<?php
// Receive patient details
$name = $_POST['name'];
$address = $_POST['address'];
$birthdate = $_POST['birthdate'];
$mobile = $_POST['mobile'];
// Receive health details
$medicare = $_POST['medicare'];
$healthfund = $_POST['healthfund'];
$critical = $_POST['critical'];
?>
<!DOCTYPE html>
<html>
<head>
<title>Patient and Health Details</title>
</head>
<body>
<h2>Patient Details</h2>
Name: <?php echo htmlspecialchars($name); ?><br>
Address: <?php echo htmlspecialchars($address); ?><br>
Birthdate: <?php echo htmlspecialchars($birthdate); ?><br>
Mobile: <?php echo htmlspecialchars($mobile); ?><br><br>
<h2>Health Details</h2>
Medicare Number: <?php echo htmlspecialchars($medicare); ?><br>
Health Fund: <?php echo htmlspecialchars($healthfund); ?><br>
Critical Information: <?php echo htmlspecialchars($critical); ?><br>
</body>
</html>
