Due September 19th, 10:00pm
For this assignment, you'll be using php to dynamically generate and modify the pages of your photo gallery. I suggest that you use your static html pages from the first assignment as templates for this phase.
In order to make these sites interesting, I'm providing a simple php library to save / load php arrays to disk. It's entirely possible that this library has some bugs I haven't squashed; please post to piazza if you have any trouble. The next phase will migrate to mysql for data storage, so your pages won't be using this library for long.
This requirements for this assignment fall into two broad categories:
- Using php to generate pages dynamically using an database.
- Using php to process forms to add new data to the database. All data should be validated before the database is modified.
|Dynamic Page Generation||7pt Total|
PHP-Generated Profiles, Galleries, and Photos
You need to generate photo galleries, picture pages, and profiles dynamically using php. Each script will use GET to obtain the album/photo/profile id of the album/photo/profile to display. This will allow you to link to specific pages, as we've discussed in class. I suggest you store the data for these sites as associative arrays so that you can use the library mentioned above.
You need to implement a homepage for your gallery (named index.php, of course). This homepage should have a list of users and links to the signup, album creation, and photo upload pages listed below. Each user names should link to his/her profile.
|Form Handling||8pt Total|
Sign-up Form and Handler
The first form will be a signup page for people to register with your photo gallery:
Photo Uploading and Handler
A form that uploads a new picture to an album. This form should collect a picture file, a picture title, an album name, and the password of the user to which that album belongs. The handler should validate the password against the user password in the database. Again, if validation fails, the handler should output the original form with a note about what went wrong and add the photo to the album otherwise.
Album Creation and Handler
Another form to create a new album. This form should simply take an album name, the name of the user to which the album belongs, and the user's password. To validate the data, the handler should ensure that a valid user is given and that the password matches that user's. If validation fails, the handler should output the original form with a note about what went wrong. Otherwise, the new (empty) album should be added to the gallery.
|Bonus Points||1pt Total|
Implement one of the suggested changes from the critique of Phase 1. Include a readme.txt file with your submission explaining how you implemented the change.
As with all homeworks, you will submit this project in a two-step process:
- First, place all source code (stylesheets, html, and php files) in a single p2 directory. You will submit this homework under the unique id p2 using the command-line turnin per the instructions on the course homepage.
- You will also put your assignment up on your personal webspace on z. Per the FAQ for z, you'll need to place these files in /u/z/users/cs105/YOURCSID/p2.