I’m trying to make my assignment to look like this when there’s no information typed in but I’m not sure how to do it:
My PHP so far:
<!DOCTYPE HTML>
<html>
<head>
<title>Thank You for Registering!</title>
<link rel="stylesheet" type="text/css" href="css/KingLib2_.css"/>
</head>
<body>
<br/>
<div id="logo">
<img src="KingLibLogo.jpg" alt="King Real Estate Logo">
<div id="h3">
<h3>Thank You for Registering!</h3>
</div> </h3>
<?php
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$cityofresidence = $_POST['cityofresidence'];
$birthyear = $_POST['birthyear'];
$current_year = date('Y');
$age = $current_year - $birthyear;
print "<p>Name: $firstname $lastname";
print "<p>Email: $email";
print "<p>City: $cityofresidence";
print "<p>Birth Year: $birthyear";
if ($age > 55) {
print"<p>Section: Senior</p>";
}
if ($age < 54) {
print"<p>Section: Adult</p>";
} if ($age < 14 ) {
print"<p>Section: Child</p>";
}
?>
</body>
</html>