Kaolin Fire with GUD Issues 0 through 5

kaolin fire presents :: PHP 101 :: Is PHP Running?


How many fingers do you see?


Guestbook

This needs a lot more time spent on it, but as notes for later... steps towards your own guestbook

One, simple page, that validates

Where to go from here? A guestbook:

it should have a field for someone to enter their name, their email, their website, and a short message. this info should get dropped into a database.

1) should make sure all required fields are filled (name & message, at least?) -- if not, spew some sort of error
2) when all data is entered and valid, should insert into db all proper data (versus the defaults you have)
3) if there were errors, the entered data should appear in the form again as the defaults
4) guestbook should display as a table instead of debugarray
5) guestbook should display on one page, with the option to sign it taking you to another page where the form stuff happens
6) successful signing should take you to a thankyou page with has a link to the display page :)
7) make the display sort by any of the following fields (email, name, website, date)
er, 6.5) guest book table should store the date of when the entry was saved
8) ADMIN section! let the "admin" delete guestbook entries or "reply" to them (add another field on the entry for the reply and for the date of the reply). replies can also be edited... add a column for the date of the last edit of the reply.
8.1) ** use the $_SESSION variable for storing whether someone is an admin. First, just try putting something into the $_SESSION on one page and reading it from the $_SESSION on another page. ((note: call session_start() at the top of your page))
8.2) ** make a form that asks for a user name and password. it should submit to a page that then tests whether the user name and password are valid (you can hardcode them into the page for now). If valid, you should set a flag in the session (like $_SESSION["admin"] = true;)
8.3) ** test for the $_SESSION["admin"] variable on other pages and provide a link to "log out" (that goes to a page that clears the $_SESSION["admin"] variable -- either unset($_SESSION["admin"]) or $_SESSION["admin"] = false;).
8.4) ** test for the $_SESSION["admin"] variable on other pages and provide links to delete guestbook entries
8.4.1) **** bonus - use javascript:confirm("are you sure") to double check the delete action
9) massage the display page to show the replies nested inside their given guestbook entry :)
10) make the system email you when there's a new guestbook entry
11) make the system email the guestbook poster when their entry has been replied to if they left an email address



I am soooo fake pre-loading this image so the navigation doesn't skip while loading the over state.  I know I could use the sliding doors technique to avoid this fate, but I am too lazy.