Lab Exercises: Save Web Form Data into MySQL Database
Objective: Be familiar with web form data processing. Be able to save web form data into MySQL database using PHP programs.
- Download a simple web form to your web folder in the CS server:
cp /shared/csc4341/form_insert.php ~/public_html/csc4341
- Change database connection info in the php file to your database.
- Open form_insert.php from your home page:
http://cscdevprod01.txwes.edu/~yourusername/csc4341/form_insert.php. You should see a simple web form.
- Study the sample program and then develop a student data entry form that allows the users to enter the information
of a student on the form and save the data into database. The form should look like the following sample form:
- To store student information, you need to create a table called "student" with columns for first name, last name
major, status, and email address. Feel free to choose names and types for these columns.
- Test your form and see if student info is successfully stored into the "student" table.
- Post your work on your web site.