CGI Programming 201 is available now.
Order from Amazon

CGI Programming 201
Developing Web Message Boards and Web Logs

by Jacqueline Hamilton

This sequel to CGI Programming 101 shows you how to write advanced multi-script CGI projects by creating your own Web message board. This book covers:

  • Site Design: Who is your site for? What tasks will visitors perform?
  • MySQL Database Design
  • Developing a central module for your project
  • How to choose, download and install Perl modules from CPAN
  • How to filter out HTML tags from messages
  • How to limit the number of messages displayed per page
  • How to create a password-protected administration area for your message board, with scripts to let you manage the board
  • How to expire old messages automatically
  • How to convert your message board scripts into a Web Log ("blog") for online journals or news stories

This book assumes you have some CGI programming experience. If you're just starting out, you should pick up a copy of CGI Programming 101 and work through that first.

Table of Contents / Source Code

All of the code from the book can be downloaded here. If you prefer you can also download the complete forums code (8K tarred/gzipped archive). Read the README file for installation instructions.

1. Site Design and Usability
2. Database Design
3. Message Board Module
MyBoard.txt - Message board module
4. Viewing All Forums
ch4index.txt - All Forums
index.txt - All Forums with Message Counts
5. Viewing All Messages in a Forum
ch5forum.txt - View All Messages
ch5forum2.txt - View All Messages with Navigation
6. Posting a New Message
newmsg.txt - Post New Message Form
ch6postmsg.txt - Post New Message
ch6postmsg2.txt - Post New Message, with data checking/tag filtering
7. Reading Individual Messages
message.txt - Read Message
8. Replying to Messages
postmsg.txt - Post Message
9. Tidying Up forum.cgi
ch9forum.txt - forum.cgi - show followup counts
forum.txt - forum.cgi - limit # of topics per page
10. Searching the Forums
search.txt - Search Form
search2.txt - Search CGI
11. Setting Up an Admin Area
adminindex.txt - Admin Index
12. Creating, Editing, and Deleting Forums
admincreate.txt - Create Forums
adminindex2.txt - Admin Index
adminedit.txt - Edit Forums
admindelete.txt - Delete Forums
admindelete2.txt - Delete Forums CGI
13. Deleting and Expiring Messages
adminindex3.txt - Admin Index
admincancel.txt - Cancel Message
admincancel2.txt - Cancel Message CGI
adminexpire.txt - Expire Old Messages
14. Board Administration and Security
Appendix A: Online Resources
Appendix B: Converting Your Message Board into a Blog