Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* submission.php */
- /*
- 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.
- 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.
- 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.
- GET variables are passed in the URL as http://somesite.com/index.php?hello=cruel+world&booyah=ron
- The variables are 'hello' and 'booyah'. To access them in a PHP script you would use the $_GET super global.
- $hello = $_GET['hello']; // $hello = 'cruel world';
- $booyah = $_GET['booyah']; // $booyah = 'ron';
- To access POST variables, we use the $_POST super global.
- Requirements:
- 1.Your pages must be developed using HTML and saved as PHP files.
- All this means is that the pages will be written as HTML pages, saved with the extension '.php'.
- The server is configured to process all pages with the extension '.php' for php script. If it has
- none, then it simply outputs the HTML.
- So now lets start building the form. We'll make it real simple, no label or accessibility. Plain bare
- bones. Submission page is the page that the user will 'Submit' the form from.
- 2.Your submission page will contain a form that will obtain the following from the user:
- a.First Name
- b.Last Name
- c.Address
- d.City
- e.State
- f.Zip Code
- g.Create Username
- h.Create Password
- 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.
- */
- ?>
- <html>
- <head>
- <title>New User Registration</title>
- </head>
- <body>
- <form method="post" action="process.php">
- First Name: <input type="text" name="first_name">
- <br>
- Last Name: <input type="text" name="last_name">
- <br>
- Address: <input type="text" name="address">
- <br>
- City: <input type="text" name="city">
- <br>
- Zip Code: <input type="text" name="zip_code">
- <br>
- Create Username: <input type="text" name="create_username">
- <br>
- Create Password: <input type="password" name="create_password">
- <br>
- <input type="submit" name="submit_btn" value="Submit">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement