Chapter 13: Tell-a-Friend System 461 . After setting (Web hosting mysql)

Chapter 13: Tell-a-Friend System 461 . After setting the score per each friend, the total score for the originator is calculated and set at the bottom of the template. . At the end, the template is parsed and printed to the user to give her a scorecard report. Installing a Tell-a-Friend System Here I assume that you re using a Linux system with MySQL and Apache server installed. Your Internet web server document root directory is /evoknow/ intranet/htdocs. Of course, if you have a different path, which is likely, you should change this path whenever you see it in a configuration file or instruction in this chapter. During the installation process, I refer to this directory as %DocumentRoot%. I also assume that you ve installed the PHPLIB and PEAR library. Normally, these get installed during PHP installation. For your convenience, I ve provided these in the lib/phplib.tar.gz and lib/pear.tar.gz directories on the CD-ROM. In these sample installation steps, I assume that these are installed in the /%DocumentRoot%/phplib and /%DocumentRoot%/pear directories. Because your installation locations for these libraries are likely to differ, make sure you replace these paths in the configuration files. Here is how you can get your Tell-a-Friend applications up and running: 1. Install the application framework. If you have not yet installed the application framework discussed in Chapter 4, you must do so before proceeding further. 2. Install the Tell-a-Friend Database. The quickest way to create the Tell-a- Friend database is to run the following commands: mysqladmin u root p create TELL_A_FRIEND mysql u root p D TAF < taf.sql 3. Install the Tell-a-Friend applications. Now from the ch13 directory on the CD-ROM, extract ch13.tar.gz in %DocuemntRoot%. This will create taf in your document root. Configure %DocumentRoot%/taf/apps/ contact.conf for path and database settings. The applications are installed in the %DocumentRoot%/taf/apps directory and the templates are stored in %DocumentRoot%/taf/apps/templates. If your MySQL server is hosted on the web server, it can be accessed via localhost. However, if this is not the case, you can easily modify the database URLs in each application s configuration files. For example, the contact.conf file has a MySQL database access URLs such as the following: define( TAF_DB_URL , mysql://root:foobar@localhost/TELL_A_FRI END );

Leave a Reply