<?php function data_good() { return isset($_POST["submitted"]) and isset($_POST["firstName"]) and isset($_POST["lastName"]) and isset($_POST["e-mail"]); }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/xhtml1-strict.dtd"><html> <head> <title>Grand Canyon Home Rentals -- Newsletter</title> <link rel="stylesheet" type="text/css" href="layout.css" /> </head> <body> <div id="container"> <?php require("nav.php"); ?> <div id="content"> <?php if(data_good()){?> Thank you for filling out our form! You have not been added to our newsletter, because this site isn't done yet. <?php } else{ if (isset($_POST["submitted"]) {?> There was an error in your form submission. Please try again. <?php }?> Please fill out our form. We will add you to our e-mail newsletter and inform you when new houses are available to rent.<br /> <a href="privacy.php">Read our privacy policy</a> <form action="newsletter.php" method="post"> First name: <input type="text" name="firstName" /><br /> Last name: <input type="text" name="lastName" /><br /> E-mail: <input type="text" name="e-mail" /><br /> <input type="submit" value="Join our newsletter!" /> <input type="hidden" name="submitted" /> </form> <?php }?> </div> </div> </body></html>