Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment Create an HTML form that will accept customer information. You should include fields for First Name Last Name, phone number, and email address. Name
Assignment Create an HTML form that will accept customer information. You should include fields for "First Name" "Last Name", "phone number", and "email address". Name your html file updateInfo.html. Your form should have a reset button and a submit button. Your input fields for your form should be inside of a table. The submit button should send the data to a php file named updateInfo.php. The updateInfo.php file should check the data submitted by the html file for proper formatting. The first name and last name should be composed of only letters and at most length 20 each (don't allow a length 0 for any of the fields either). The phone number should be all digits, and length of exactly 10 area code plus number). Do not input dashes, just a 10-digit phone number. The email address can be length at most 20, and should have an @", and be composed of only letters and numbers (This is not true for REAL email addresses, but I am doing it this way to simplify the assignment. Real email addresses can have many other characters in them. Again, to simplify, it is ok if the "@" is at the end of the address, i.e. "david 123@" or @david123" can be valid email addresses in our system). If any field has incorrect data, display an error message and a link back to the updateInfo.html page. If all the fields are valid, your PHP script should save the data into a file named customerInfo.txt which should have the following format, and be sorted by "Last Name". (Note you will need to read in the existing file's data and add the new data to your data structure, and sort it before you can write the new file in the proper order). Put each record on its own line. Assume that last names are unique- i.e. you can use last name as a key for your associative array. LastName: FirstName: 123-456-7890:emailaddress Note that you will need to format your phone number input to add dashes to the number. Once the new data has been received, you should also display ALL data that has been entered into the text file from your PHP script into an HTML table. The table should be sorted by last name just like the text file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started