Question: please help me finish and code this problem that i need to know to learn about this: You are writing a program that will allow
please help me finish and code this problem that i need to know to learn about this: You are writing a program that will allow students to order food items from Commons. The HTML
page formtobuy. html will have a form that submits to placeorder.php Then placeorder.php will output
a web page will do some checks and write the customers info to a database table.
Download formtobuy.html formtobuy.css orders.sql
The HTML file formtobuy.html has an HTML form with name, credit card number, creditcardtype text
boxes, dropdown menu for food items, and radio buttons for pickup time.
You need to give values to the name, action and method attributes of the form tag
You need to give values to the name attribute for the customer name, credit card
number, credit card type text boxes, and the select box
You also need to give values to the value attribute of the option tag within the select
box.
You need to give values to the name and value attributes for the radio buttons
Your page will look like this after you put in the CSS:
Place an order here!
Select the item you want to order and give us your name and credit card information.
Customer name:
Credit Card number:
Credit card type:
Food items Burrito
Pickup time:
Moming
Afternoon
Evening
Check to make sure that the credit card number is composed of exactly digits
Hint: You will need to use ifstatements, pregmatch, regular expressions to perform these checks.
Your code to perform these checks should be in the PHP
If credit card check does not pass, then, display an error message to the user and provide a link
back to the formtobuy.html page. The error page should look like this:
Here are your order details
Invalid credit card number andor type
Credit card numbers must be digits long
Go back to enter valid info
If the user supplied data is in correct format, then display the name, credit card number and
type Visa or MasterCard the item ordered and the pickup time to the user. The correct info
page should look like this:
Here are your order details
order details:
Customer name: sreedevi
Credit card number:
Credit card type: visa
Food ordered: burrito
Pickup time: morn
Adding order to the database
Also, if the user supplied data is correct, then, write the data to the database table, orders.
Given to you is the file orders.sql which you can use to create a new orders table and insert one row in
the table.
Then, you will need to add to the php program to take the data from the form and insert into the orders
table.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
