I have this simple form. After filling it out the use hits submit and is brought to a page displaying the information entered. I need code to return to the form if no data is entered and the user hits submit. Below is the code I assume i need some code in the else clause??
</head>
<body>
<p>Please Enter the Requested Information</p>
<br />
<?php
if (isset($GET['contact'])){
$firstname = $GET['firstname'];
$lastname = $GET['lastname'];
$street = $GET['street'];
$city = $GET['city'];
$state = $GET['state'];
$zip = $_GET['zip'];
echo "<p> Here is the information you have entered. You entered: </p><p> $firstname $lastname </p> <p> $street </p> <p> $city , $state $zip </p>";
} else { ?>
</p>
<form name="contact" id="contact" method="get" action="<?php echo $_SERVER['PHP_SELF']. '#form';?>">
<p><label>First Name
<input name="firstname" type="text" id="firstname" />
</label></p>
<p><label>Last Name
<input name="lastname" type="text" id="lastname" />
</label></p>
<p><label>Street
<input name="street" type="text" id="street" />
</label></p>
<p><label>City
<input name="city" type="text" id="city" />
</label></p>
<p><label>State
<input name="state" type="text" id="state" />
</label></p>
<p><label>Zip Code
<input name="zip" type="text" id="zip" />
</label></p>
<input name="contact" type="submit" value="submit" />
<?php
} ?>
</body>
</html>