Lab 2
Lab Exercise: 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.
Steps:
- Create a directory named as lab2 inside csc6341. Download a simple web form to your web directory on the server:
cd ~/public_html/csc6341
mkdir lab2
cp /shared/csc6341/form_insert.php ~/public_html/csc6341/lab2
- Change database connection info in the php file to your database.
- Open form_insert.php from your home page:
https://cscdevprod03.txwes.edu/~yourusername/csc6341/lab2/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.