Practical PHP and MySQL
Chapter 9
The entire chapter is about building an FAQ site.
Exercise
- You Ask the Questions (faq)
- This won't work on my server because of session issues, so view it on the school's servers. This site also works perfectly. We were required to add something to it, so besides my usual additions I chose to add question and comment delete functionalities. Since the admin login screen isn't linked, I'll do so here: login as admin.
User Login:
Username: user
Password: passAdmin Login:
Username: admin
Password: admin
What I Added, In No Particular Order
- Tried to code to XHTML 1.0 Standards, where possible
- elements in wrapping tags
- closed all tags
- added labels to forms
- added titles to non-contextual links (such as the delete buttons [x])
- Minor updates throughout for visual organization
- Put all user defined functions into the functions file
- altered functions to be reused
- Made links contextual, vs. "click here"
- Made question lists with summaries definition lists vs. tables
- Updated sidebar functionality
- made navigation into unordered lists vs. tables
- made information sort alphabetically
- made topic list always display vs. disappearing when answers are displayed
- Made summary ellipses dependant on length
- summaries shorter or equal to cut-off length will have no ellipses
- Tried to keep functionality look consistent
- links wrapped in brackets []
- delete buttons superscript
- Increased comment title length from 20 characters to 100
- Added zebra striping to certain tables
- comments table
- question moderation table
- admin pending subject owner tables
- Streamlined admin control panel
- eliminated unnecessary redundancy
- organized more like user control panel
- Created registration form
- Added "add new topic" link to create question form
- Added "delete question" functionality for administrator, delete available from
- sidebar
- question list after selecting topic
- answer
- Added "delete comment" functionality, comments can be deleted by
- the commenter
- the owner of the question
- the administrator