Source code example for Web Database Applications

Unless otherwise stated, the source code distributed with this book can be
redistributed in source or binary form so long as an acknowledgment appears
in derived source files.
The citation should list that the code comes from Hugh E.
Williams and David Lane, "Web Database Application with PHP and MySQL"
published by O'Reilly & Associates.
This code is under copyright and cannot be included in any other book,
publication, or educational product without permission from O'Reilly &
Associates.
No warranty is attached; we cannot take responsibility for errors or fitness
for use.

-------

How to install this code:

(1) Uncompress the archive into your Apache document tree

    Example:

    mkdir /usr/local/apache/htdocs/winestore-4.2

    cp wda.4.2.tar.gz /usr/local/apache/htdocs/winestore-4.2
    OR
    cp wda.4.2.zip /usr/local/apache/htdocs/winestore-4.2

    cd /usr/local/apache/htdocs/winestore-4.2

    tar xvzf wda.4.2.tar.gz 
    OR 
    unzip wda.4.2.zip

(2) Download the winestore database from:

    http://www.webdatabasebook.com/winestore.database.gz
    OR
    http://www.webdatabasebook.com/winestore.database.zip

    Create the database, tables, and sample data by following the
    instructions in Chapter 3 of our book "Web Database Application with PHP
    and MySQL", 1st Edition, 2002.

(3) Move and edit db.dummy.inc

    mv db.dummy.inc db.inc
    edit db.inc with your fave editor and change the username and password 
    variables to match your username and password for accessing MySQL

    NOTE: this creates a security problem because the user can read the
    contents of db.inc by retrieving it with their browser. There are at
    least three ways to fix this. The best is to add the following to
    your Apache httpd.conf file usually found in /usr/local/apache/conf/

    <Files ~ "\.inc$">
      Order allow,deny
      Deny from all
      Satisfy All
    </Files>

    Then, restart Apache with the command:

    /usr/local/apache/bin/apachectl

(4) Enjoy! If you followed step (1) above exactly, you should be able to
    use the application by requesting the following URL:

    http://localhost/winestore-4.2/

Any suggestions? Email hugh@hughwilliams.com. However, please note that I don't
reply to setup or programming questions.