The Official Unofficial NYU/SCPS PHP Class Website
Fall 2004 — David Mintz, Instructor
Welcome to the official unofficial site for Programming in PHP, NYU/SCPS Course # X52.9224.001.FA04
My email: dmintz followed by one of those thingies that looks like a letter A inside a circle followed by the domain name of this site.
Session Ten: December 2, 2004
- Lecture notes (MS Word)
- Code examples (zipfile). Some of these examples absolutely require PHP 5.
Session Nine: November 18, 2004
- Lecture notes (MS Word)
- Code examples (zipfile)
Session Eight: November 11, 2004
- Lecture notes (MS Word)
- Code examples (zipfile)
Session Seven: November 4, 2004
Here's the assignment:
- Download week7.zip and unpack it somewhere in your web docs directory
- Feed week7/php_univ.sql to your MySQL server
- Modify week7/.htaccess to set the include_path directive appropriately for your system
- Get the "PHP University" sample application running and play with it to get a feel for its functionality. Try finding, modifying, inserting and deleting database records with this application. Run my_workshops.php, and register and un-register for some workshops. (You can steal login credentials from one of the student records in the student table; the passwords are clear text.)
- If you find bugs, please report them (better yet, report them and suggest a fix (-:)
- Now the coding: write two scripts, one called instructors.php and one called edit_instructor.php
- instructors.php simply displays a list of all the instructor records in the instructor table. Each last name
is an href link to edit_instructor.php?id=n where n is the id of each record.
- edit_instructor.php follows the same pattern as edit_student.php.
If it gets an id as a GET parameter, it fetches the corresponding row of data and displays a form pre-populated with that data (otherwise it displays a form with all blank field values).
The form's method is POST. The id is included in the form as a hidden field. The form has submit buttons labeled "Save" and "Delete." When POSTed, edit_instructor will do reasonable input validation, then either an INSERT or UPDATE or DELETE query on the instructor table, depending on which button was clicked and whether a record id number is submitted with the form (no id, it's an INSERT; yes id, it's a UPDATE).
If you DELETE, also execute an UPDATE on the 'workshop' table setting the instructor_id fields to zero in the related records.
It is hereby decreed: This assignment is worth 20 points, not 10, and it is due on Thursday November 18, not the 11th.
The Session 7 lecture notes are here.
Session Six: October 28, 2004
- Lecture notes (MS Word)
- Code examples (not available live on this site; you will need to run them on your own system)
- Assignment
- guestbook.php source (companion file for assignment)
Session Five: October 21, 2004
- Here is a recap of some important points about cookies and sessions.
- Lecture notes (MS Word)
- Code examples (zipfile)
- Code examples (online)
Session Four: October 14, 2004
- Session 4 lecture notes (MS Word)
- Week 4 Assignment
- Code examples to view/run
- Code examples to download (zipfile)
Session Three: October 7, 2004
The Session 3 Assignment is here for you to download. Here is a screenshot of sample input/output.
- Session 3 lecture notes (MS Word).
- Run examples and view source
- Download examples as zip file
- To see how your solution should work, try this
New rule (to borrow Bill Maher's phrase): please follow directions, e.g., hand in assignments on time and in the manner indicated, i.e., physical media or BlackBoard/DropBox. No more Mister Nice Guy.
Session Two: September 30, 2004
- Session Two lecture notes (MS Word)
- The week 2 assignment and the stub to use to create your homework assignment.
- Run/view the code examples
- Download code examples (zipfile)
Session One: September 23, 2004
Here are the handouts in (gasp!) Microsoft Word format
Here are the code examples
and the code I'd like you to run on your own (Linux|Windows|OS X)AMP system is here.
OS X Installation Notes
One of our students shares some notes on her experience getting AMP set up on OS X, and I quote:
I checked out xampp, and noticed that there was a linux package but no mac os x package (and though I believe you can install many linux packages ok on os x, it's also my impression that it can sometimes be fussy) -- a little more investigation turned up the fact that mac os x comes pre-installed with apache and php, so it's more a matter of turning them on and then installing mysql. Here's a set of urls I found very helpful.
general info & links:
http://lists.nyphp.org/pipermail/talk/2004-August/011456.html
http://lists.nyphp.org/pipermail/talk/2004-July/010975.html
activating apache:
http://www.macdevcenter.com/pub/a/mac/2003/04/04/apache_jaguar_pt1.html
turning on php
http://www.sanbeiji.com/tech/tutorials/php/index.php
installing mysql:
http://www.entropy.ch/software/macosx/mysql/
all seem to work well as advertised (!) & I believe I was able to turn everything on and install mysql just fine.
Thanks for sharing, to coin a phrase!
Last updated 2011-11-10 6:27 am