Online Book Reader

Home Category

HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [363]

By Root 1364 0
Check the password and continue only if the user is authorized.

4. Print the form contents.

Ensure the form contents are what you expect before passing data to a database.

5. Connect to the database.

Build a standard database connection so you can pass the query to the database.

6. Build the query.

Send the query to the database. Check that the query contains the data you expect. (You might not print the actual query in a final pass, but it’s great for debugging.) Also, send back the results of the mysql_error() function if something went wrong.


Improving the dbCMS design

Although the simple PHP/MySQL combination described in the last section is a suitable starting point, you probably want to do a bit more to make a complete CMS, because a better CMS might have the following features:

♦ Automatic menu generation: The menu system in dbCMS is too static as it is. Your database should keep track of where each page is located in the system, and your menu code should be dynamically generated based on this information.

♦ Better flexibility: To keep the code simple, I made only one page type, and the page always has exactly two content blocks. You’ll want a much more flexible design.

♦ Error-checking: This program isn’t nearly robust enough for real use (yet). It crashes if the data isn’t complete. Before you can use this system in a real application, you need a way to improve its “crash-worthiness.”

♦ Improved data input: The very basic input form described in this chapter is fine, but it could certainly be improved. Loading the block type and page data directly from the database would be better. It would also be nice if the user could create new block types. Still, this basic CMS shows how you can start building your own content systems.

Appendix A: What’s on the CD

In This Appendix

System requirements

Using the CD

What you’ll find on the CD

Troubleshooting


System Requirements

Make sure that your computer meets the minimum system requirements shown in the following list. If your computer doesn’t match up to most of these requirements, you may have problems using the software and files on the CD. For the latest and greatest information, please refer to the ReadMe file located at the root of the CD-ROM.

♦ A PC running Microsoft Windows 98, Windows 2000, Windows NT4 (with SP4 or later), Windows Me, Windows XP, Windows Vista, or Windows 7.

♦ A Macintosh running Apple OS X or later.

♦ A PC running a version of Linux with kernel 2.4 or greater.

♦ An Internet connection

♦ A CD-ROM drive

If you need more information on the basics, check out these books published by Wiley Publishing, Inc.: PCs For Dummies, by Dan Gookin; Macs For Dummies, 9th Edition, by Edward C. Baig; iMac For Dummies, 5th Edition, by Mark Chambers; Windows 95 For Dummies, Windows 98 For Dummies, Windows 2000 Professional For Dummies, Microsoft Windows ME Millennium Edition For Dummies, Windows Vista For Dummies, Windows 7 For Dummies, all by Andy Rathbone.


Using the CD

To install the items from the CD to your hard drive, follow these steps.

1. Insert the CD into your computer’s CD-ROM drive. The license agreement appears.

Note to Windows users: The interface won’t launch if you have autorun disabled. In that case, click Start⇒Run (For Windows Vista, Start⇒All Programs⇒Accessories⇒Run). In the dialog box that appears, type D:\Start.exe. (Replace D with the proper letter if your CD drive uses a different letter. If you don’t know the letter, see how your CD drive is listed under My Computer.) Click OK.

Note for Mac Users: The CD icon will appear on your desktop, double-click the icon to open the CD and double-click the “Start” icon.

Note for Linux Users: The specifics of mounting and using CDs vary greatly between different versions of Linux, and unfortunately we can’t provide instructions for every version of Linux. Please see the manual or help information for your specific system if you experience trouble using this CD.

2. Read through the license agreement and then click

Return Main Page Previous Page Next Page

®Online Book Reader