W3818 php Collecting Data to CSV file
Prerequisites[edit]
Background[edit]
Introduction[edit]
Topic Headers[edit]
Key Concepts[edit]
Exercises[edit]
Part 1[edit]
You've been commissioned to create a new website for your local zoo. Create a website promoting the zoo:
- Comprised of at least two pages linked to one another
- Using CSS formatting that includes at least:
- Centered text
- Colored text
- Colored background
- Two each of class and id selectors
- Three different font sizes/styles
- Containing at least ten relevant images, positioned and sized appropriately
- Aesthetically designed
- The HTML and CSS must be in separate files
![]() |
Helpful Hint |
Images may be downloaded by using wget and then setting the permissions appropriately. For example: wget https://sample.images.com/apple.jpg
chmod a+r apple.jpg
|
After the above has been completed, notify your invigilator for grading. Then:
Part 2[edit]
Create a third page which contains a contact form and collects, at minimum, the user's first name, last name, and email address. When the user submits the form, a php script must be executed which stores all of the fields along with a timestamp into a file called "contacts.csv". Each new form submissions must add a line to the existing file. After the submission, the user should be directed to an appropriate "Thank you" page.
After the above has been completed, notify your invigilator for grading.
![]() |
Helpful Hint |
In order to enable the web server to write the file, permissions will need to be adjusted. Execute the following: touch contacts.csv
setfacl -m u:www-data:rw contacts.csv
|
Part 3[edit]
Create a program, written in any language of your choice supported by the server, that will read and parse the "contacts.csv" file and write a new file (in the same directory). The lines in the new file must be sorted alphabetically by the user's lastName and firstName. The new file must be named "contacts-sorted.csv".
After the above has been completed, notify your invigilator for grading.