Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (array_key_exists('submit', $_POST))
- {
- foreach ($_POST as $key => $val)
- {
- ${$key} = trim( strip_tags($val) );
- // Not needed, just a flag for this sample
- $submitted = TRUE;
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <style type="text/css">
- input
- {
- display:block;
- margin-bottom:10px;
- }
- form
- {
- margin-top:15px;
- }
- </style>
- </head>
- <body>
- <?php
- if(isset($submitted))
- {
- echo "$street, $city, $state, $zip";
- }
- ?>
- <form method="post" id="form1" action="<?php htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'); ?>">
- <fieldset>
- <legend>Personal Information</legend>
- <label>First Name</label>
- <input type="text" name="firstName" id="firstName" value="" tabindex="1" />
- <label>last Name</label>
- <input type="text" name="lastName" id="lastName" value="" tabindex="2" />
- <label>Email Address</label>
- <input type="text" name="email" id="email" value="" tabindex="3" />
- <label>Street</label>
- <input type="text" name="street" id="street" value="" tabindex="4" />
- <label>City</label>
- <input type="text" name="city" id="city" value="" tabindex="5" />
- <label>State</label>
- <input type="text" name="state" id="state" value="" tabindex="7" />
- <label>Zip</label>
- <input type="text" name="zip" id="zip" value="" tabindex="8" />
- <input type="submit" name="submit" id="submit" value="Submit" tabindex="7" />
- </fieldset>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement