Lab 2

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.

  1. Download a simple web form to your web folder in the CS server: cp /shared/csc4341/form_insert.php ~/public_html/csc4341
  2. Change database connection info in the php file to your database.
  3. Open form_insert.php from your home page: You should see a simple web form.
  4. 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:
  5. 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.
  6. Test your form and see if student info is successfully stored into the "student" table.
  7. Post your work on your web site.