hip1/11.5/page2.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$f_name = $_POST['f_name'];
$m_name = $_POST['m_name'];
$l_name = $_POST['l_name'];
$birthdate = $_POST['birthdate'];
$gender = $_POST['gender'];
$country = $_POST['country'];
$selectedgender[$gender] = 'checked';
echo "<form method='post' action='page3.php'>
<div>First name: <input type='text' name='f_name' value='$f_name' readonly></div>";
if($m_name){
echo "<div>Middle name: <input type='text' name='m_name' value='$m_name' readonly></div>";
}
echo "<div>Last name: <input type='text' name='l_name' value='$l_name' readonly></div>
<div>Date of birth: <input type='date' name='birthdate' value='$birthdate' readonly></div>
<div>Gender: <input type='radio' id='male' value='Male' $selectedgender[Male] disabled>
<label for='male''>Male </label>
<input type='radio' id='female' value='Female' $selectedgender[Female] disabled>
<label for='female'>Female </label>
<input type='radio' id='other' value='Other' $selectedgender[Other] disabled>
<label for='other'>Other</label></div>
<div><input type='radio' name='gender' id='male' value='Male' $selectedgender[Male] hidden>
<label for='male''></label>
<input type='radio' name='gender' id='female' value='Female' $selectedgender[Female] hidden>
<label for='female'></label>
<input type='radio' name='gender' id='other' value='Other' $selectedgender[Other] hidden>
<label for='other'></label></div>
<div>Country: <input type='text' name='country' value='$country' readonly></div>
<div>Book 1: <input type='text' name='book1'></div>
<div>Book 2: <input type='text' name='book2'></div>
<div>Book 3: <input type='text' name='book3'></div>
<div>Book 4: <input type='text' name='book4'></div>
<div>Book 5: <input type='text' name='book5'></div>
<div><input type='submit' value='submit'></div>
</form>";
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse