PHP programming assignments for Fall
Assignment 1:
Create a simple PHP page which generates one of two things based on the value of the HTTP_REFERER variable. If that variable is the empty string (not set), simply give a short message that the user didn't come from anywhere. If it is set, generate an HTML link to return to whereever you came from. Here is a simple one.
Simply leave your page online on sandbox. Call it a1.php, and store it in a directory named csc231 under local_html under your own account on Sandbox. I'll run it and collect a copy of the source from there. Please leave the file in place at least until you receive a grade.
Assignment 2:
Create a PHP web page which prints the current time in various formats and colors depending on the query string. Your php page is intended to be loaded with a simple query string which controls how the time is displayed, the page title and the background and text colors. The query string has three fields separated by colons. The first is the time format, the second is the text color and the third is the background color.
Read more details
Assignment 3:
Use PHP to produce an on-line hangman game like this one. The game chooses a word of at least five characters at random, and the player tries to figure out what word has been chosen by guessing letters. They player must find the word with no more than six incorrect guesses.
The word is initially shown as a sequence of blanks, one for each letter. When a letter is guessed, if it occurs in the chosen word, the blank(s) where that letter resides are replaced with the letter. If it does not appear in the word, it counts as a wrong guess, and one part is added to the stick figure on the stick gallows. The figure has six parts. If a wrong guess is made after the figure is fully drawn, the player loses. If all the letters are guessed, the player wins.
Assignment 4:
A Barter Way
This assignment is to create a prototype auction site like this one. As usual, you are free to copy the HTML generated by this program in building your own.
Reference: