CSCI 217 Homework 10 In this assignment you modify the form from Homework 9 to store the information in a database instead of sending you an email.
The database is located on machine 155.225.48.42, with username "student" and the password "csci21701". The database is called visitors (plural) and contains a table called visitor (singular) with the following fields:
Field Name Field Type ID Automatic number DateEntered Time/date FirstName text, 20 characters LastName text, 20 characters text, 45 characters VisitorType text, 1 character Evaluation text, 1 character Reason varchar, up to 255 characters Comments varchar, up to 255 characters You will do two main things in this assignment:
- Modify a copy of your Homework 9 page, and save it as hw10.html.
- Modify your copy of the handleform.php script to provide a customized, nicely-styled "Thank You" page.
The hw10.html page will allow a visitor to input data. It should contain one hidden field that has your name as its value, in addition to the fields you already have in the form. You must display the value of the author field somewhere on your Thank you page (see below). Use the field names in the database for the input box names. Change the form action so that data is handled by the <Your Last Name>.php file instead of sending you an email.
Right-click on the handleform.php.txt link and save a copy as <Your Last Name>.php in the same directory as your hw10.html page. You should not have to write any code to insert and retrieve form information to/from the database. However, you want to return to the visitor a nicely-formatted HTML document that thanks them for their comment, displays their input, and provides a link for them to return to somewhere on your site. Your reply should be personalized, for example, saying something like
"Thank you John Smith for your comments on my site. Here is what you submitted."To do this, you will have to add HTML and/or PHP, possibly including stylesheet information, to this file. You may modify the file anyway you like as long as you meet the requirements for the assignment.
The form page and the PHP file should be stored on your website and linked from your homework page.