Advertisement
hugoburiel

SO-7664670

Oct 5th, 2011
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.51 KB | None | 0 0
  1. <?php
  2. if (array_key_exists('submit', $_POST))
  3. {
  4.     foreach ($_POST as $key => $val)
  5.     {
  6.         ${$key} = trim( strip_tags($val) );
  7.        
  8.         // Not needed, just a flag for this sample
  9.         $submitted = TRUE;
  10.     }
  11. }
  12. ?>
  13. <!DOCTYPE html>
  14. <html>
  15. <head>
  16. <meta charset="utf-8">
  17. <style type="text/css">
  18. input
  19. {
  20.     display:block;
  21.     margin-bottom:10px;
  22. }
  23. form
  24. {
  25.     margin-top:15px;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <?php
  31. if(isset($submitted))
  32. {
  33.     echo "$street, $city, $state, $zip";
  34. }
  35. ?>
  36. <form method="post" id="form1" action="<?php htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'); ?>">
  37. <fieldset>
  38.     <legend>Personal Information</legend>
  39.     <label>First Name</label>
  40.     <input type="text" name="firstName" id="firstName" value="" tabindex="1" />
  41.  
  42.     <label>last Name</label>
  43.     <input type="text" name="lastName" id="lastName" value="" tabindex="2" />
  44.  
  45.     <label>Email Address</label>
  46.     <input type="text" name="email" id="email" value="" tabindex="3" />
  47.  
  48.     <label>Street</label>
  49.     <input type="text" name="street" id="street" value="" tabindex="4" />
  50.  
  51.     <label>City</label>
  52.     <input type="text" name="city" id="city" value="" tabindex="5" />
  53.  
  54.     <label>State</label>
  55.     <input type="text" name="state" id="state" value="" tabindex="7" />
  56.  
  57.     <label>Zip</label>
  58.     <input type="text" name="zip" id="zip" value="" tabindex="8" />
  59.  
  60.     <input type="submit" name="submit" id="submit" value="Submit" tabindex="7" />
  61. </fieldset>
  62. </form>
  63. </body>
  64. </html>
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement