Advertisement
gitlez

YA: submission.php WC

Apr 21st, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.86 KB | None | 0 0
  1. <?php
  2. /*    submission.php    */
  3.  
  4. /*    
  5.     As you move into the project for this course, you will have to develop an online mechanism for registering new customers. For this exercise, you will need to create a page using HTML and PHP to create a customer registration page.
  6.  
  7.         You will need to develop a submission page, which will pass its contents post to another page. Once you explore MySQL, we will post into a database but for now, we want to explore the concept of POST.
  8.         POST is a request method. There are several, but the main two are GET and POST.  POST is typically used to post data to the server, and get is the typical method in which a page is requested.
  9.         GET variables are passed in the URL as http://somesite.com/index.php?hello=cruel+world&booyah=ron
  10.         The variables are 'hello' and 'booyah'. To access them in a PHP script you would use the $_GET super global.
  11.         $hello = $_GET['hello']; // $hello = 'cruel world';
  12.         $booyah = $_GET['booyah']; // $booyah = 'ron';
  13.        
  14.         To access POST variables, we use the $_POST super global.
  15.        
  16.        
  17.         Requirements:
  18.  
  19.  
  20.         1.Your pages must be developed using HTML and saved as PHP files.
  21.         All this means is that the pages will be written as HTML pages, saved with the extension '.php'.
  22.         The server is configured to process all pages with the extension '.php' for php script. If it has
  23.         none, then it simply outputs the HTML.        
  24.  
  25.  
  26.  
  27.     So now lets start building the form. We'll make it real simple, no label or accessibility. Plain bare
  28.     bones. Submission page is the page that the user will 'Submit' the form from.
  29.    
  30.         2.Your submission page will contain a form that will obtain the following from the user:
  31.         a.First Name
  32.         b.Last Name
  33.         c.Address
  34.         d.City
  35.         e.State
  36.         f.Zip Code
  37.         g.Create Username
  38.         h.Create Password
  39.  
  40.     3.There must be a button labeled as [Submit] that users can click on to submit the information. Your post page will act as a confirmation for the previous page and display the information entered.
  41. */
  42. ?>
  43. <html>
  44.     <head>
  45.         <title>New User Registration</title>
  46.     </head>
  47. <body>
  48.     <form method="post" action="process.php">
  49.         First Name: <input type="text" name="first_name">
  50.         <br>
  51.         Last Name: <input type="text" name="last_name">
  52.         <br>
  53.         Address: <input type="text" name="address">
  54.         <br>
  55.         City: <input type="text" name="city">
  56.         <br>
  57.         Zip Code: <input type="text" name="zip_code">
  58.         <br>
  59.         Create Username: <input type="text" name="create_username">
  60.         <br>
  61.         Create Password: <input type="password" name="create_password">
  62.         <br>
  63.         <input type="submit" name="submit_btn" value="Submit">
  64.     </form>
  65. </body>
  66. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement