Lesson 16. Hand-Coding a Basic CMS

As the final activity in the book, you'll build a content management system for the country profiles. Using it, Newland Tours employees will be able to insert new country profiles, and modify or delete existing country profiles, using simple HTML forms as their interface. You've already used UPDATE and INSERT SQL statements to manage content, so the only new SQL in this lesson is the DELETE statement.

You will hand-code a complete content management system from the ground up, enabling users to maintain site content using Web forms.

graphics/16fig01.gif

In this lesson, in contrast to the previous lessons where you built pages that inserted and updated data, you will not rely on Dreamweaver server behaviors. It is not that anything is wrong with using server behaviors, but one of the primary goals of this book is to give you the conceptual underpinnings and experience working with code that will empower you to create your own dynamic sites. And as I've stressed through out the book, building dynamic sites usually requires some level of competence with ASP or ColdFusion code. Although server behaviors are convenient, some of them effectively mask what's going on, enabling you to add functionalities that you don't even understand. That's great for rapid development, but not good for learning. And the code generated by the server behaviors is often incredibly complextoo complex for someone new to dynamic development to read. This complexity is often due to Dreamweaver's need for a given server behavior to work under a tremendous variety of circumstances, rather than the task itself. But it means that you often can't deconstruct the server behaviors that you add. (ColdFusion users are more likely to understand Dreamweaver's server behavior code than ASP users, due to the intrinsic nature of each language.) Avoiding server behaviors in this lesson will teach you more than you would otherwise learn.

Much of what you'll do in this lesson is not new. You'll build a group of pages that work together to handle certain functionalities. You'll create forms that collect information from the user. You'll use SQL to retrieve data from and send it to a database. You'll have a master-detail page pairing. The difference is that you'll put it all together in one lesson, and you will do all of it manually.

At the same time, the directions will be a little more high level. That is, for certain tasks you have done over and over again in this book (such as creating new pages and mocking up form interfaces), I will not provide detailed step-by-step instructions, but will assume you can manage with comparatively less guidance. That will enable the lesson to focus on the more challenging aspects of the jobconnecting ASP and ColdFusion to a database and writing the queries that will make the CMS work.

WHAT YOU WILL LEARN

In this lesson, you will:

  • Build a coordinated content management system, enabling users to insert, update, and delete data

  • Develop the code with minimal reliance on Dreamweaver's GUI

  • Hand-write your own code to make database connections

  • Make use of SQL's INSERT, UPDATE, and DELETE statements

APPROXIMATE TIME

This lesson takes approximately three hours to complete.

LESSON FILES

Starting Files:

Lesson16/Start/newland/admin_template.asp

Completed Files:

Lesson16/Complete/newland/admin_cp_insert.asp

Lesson16/Complete/newland/admin_cp_insert_processor.asp

Lesson16/Complete/newland/admin_cp_master.asp

Lesson16/Complete/newland/admin_cp_update.asp

Lesson16/Complete/newland/admin_cp_update_processor.asp

Lesson16/Complete/newland/admin_cp_delete_processor.asp