Fedora web server - 810Part VCase Studiesevery day now you can do it

810Part VCase Studiesevery day now you can do it as frequently or infrequently as you want without having abunch of blank pages. Although they have similar names and functions, the files shown in the following listings are somewhat different from the preceding set. You also need a script called weblog_db_ create.phpto create the database (unless you d rather do it using the MySQL command-linetool); if you want to edit previous entries, you have to add a script called db_logedit.php. Most of these scripts will not fail gracefully if the database has no data in it, particularly user- names and passwords in the logintable. Because the whole thing is designed to be non- functional until you enter at least one entry into these tables, and we want you to focus onthe main functionality rather than error-checking, there didn t seem to be a lot of point intesting for empty tables. If it s important to you, feel free to alter the code that follows. Listings 43-11 through 43-16 are the files you need for a database-enabled Weblog. Listing 43-11:Included database password file (db_password.inc) Put db_password.incsomewhere outside your Web tree, such as in your home directory. This will prevent your database passwords from being visible in a Web page or available toanyone who can get into your Web directory. Listing 43-12:Database creation script (weblog_db_create.php) 0) { echo ( Successfully created database.
n ); mysql_select_db( weblogs ); $query = CREATE TABLE login (ID SMALLINT NOT NULLAUTO_INCREMENT PRIMARY KEY, username VARCHAR(20), passwordVARCHAR(20)) ; Caution49
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Leave a Reply