| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| <title>Aliens Abducted Me - Report an Abduction</title> |
| <link rel="stylesheet" type="text/css" href="style.css" /> |
| </head> |
| <body> |
| <h2>Aliens Abducted Me - Report an Abduction</h2> |
| |
| <p>Share your story of alien abduction:</p> |
| <form method="post" action=""> |
| <label for="firstname">First name:</label> |
| <input type="text" id="firstname" name="firstname" /><br /> |
| <label for="lastname">Last name:</label> |
| <input type="text" id="lastname" name="lastname" /><br /> |
| <label for="email">What is your email address?</label> |
| <input type="text" id="email" name="email" /><br /> |
| <label for="whenithappened">When did it happen?</label> |
| <input type="text" id="whenithappened" name="whenithappened" /><br /> |
| <label for="howlong">How long were you gone?</label> |
| <input type="text" id="howlong" name="howlong" /><br /> |
| <label for="howmany">How many did you see?</label> |
| <input type="text" id="howmany" name="howmany" /><br /> |
| <label for="aliendescription">Describe them:</label> |
| <input type="text" id="aliendescription" name="aliendescription" size="32" /><br /> |
| <label for="whattheydid">What did they do to you?</label> |
| <input type="text" id="whattheydid" name="whattheydid" size="32" /><br /> |
| <label for="fangspotted">Have you seen my dog Fang?</label> |
| Yes <input id="fangspotted" name="fangspotted" type="radio" value="yes" /> |
| No <input id="fangspotted" name="fangspotted" type="radio" value="no" /><br /> |
| <img src="fang.jpg" width="100" height="175" |
| alt="My abducted dog Fang." /><br /> |
| <label for="other">Anything else you want to add?</label> |
| <textarea id="other" name="other"></textarea><br /> |
| <input type="submit" value="Report Abduction" name="submit" /> |
| </form> |
| </body> |
| </html> |
| |
| |
| <?php |
| |
| $firstname = $_POST['firstname']; |
| $lastname = $_POST['lastname']; |
| $email = $_POST['email']; |
| $when = $_POST['whenithappened']; |
| $howlong = $_POST['howlong']; |
| $howmany = $_POST['howmany']; |
| $description = $_POST['aliendescription']; |
| $whattheydid = $_POST['whattheydid']; |
| $fangspotted = $_POST['fangspotted']; |
| $other = $_POST['other']; |
| |
| if(isset($_POST['submit'])) |
| { |
| $fp = fopen("log.html", "a+"); |
| fwrite($fp, "Firstname: ".$firstname."<br/>"); |
| fwrite($fp, "Lastname: ".$lastname."<br/>"); |
| fwrite($fp, "Email: ".$email."<br/>"); |
| fwrite($fp, "When it happened: ".$when."<br/>"); |
| fwrite($fp, "How long they were gone: ".$howlong."<br/>"); |
| fwrite($fp, "How many aliens there were: ".$howmany."<br/>"); |
| fwrite($fp, "Description of aliens: ".$description."<br/>"); |
| fwrite($fp, "What they did: ".$whattheydid."<br/>"); |
| fwrite($fp, "Did they see my dog: ".$fangspotted."<br/>"); |
| fwrite($fp, "Other: ".$other."<br/>"); |
| fwrite($fp, "<hr>"); |
| fclose($fp); |
| |
| |
| header("Location: thanks.php"); |
| |
| } else {} |
| ?> |