Since it's a PHP script, patGuestbook needs to live somewhere under your PHP-aware Web server's document root - typically, somewhere in the directory structure holding the rest of your Web site. For purposes of this tutorial, I shall assume that the application is located in the "patGuestbook" directory under the Web server root, and is accessible at the URL http://localhost/patGuestbook/ When you uncompress the source archive, you should see a directory structure that looks something like this: Once you've got the files in an appropriate location, you also need to create some database tables to store patGuestbook data (if you're already using a database for your site, simply add patGuestbook's tables to that database). Look in the source archive's "sql" directory, where you'll find an SQL script to create two tables - "patgbguestbooks", which holds the master list of all the active guestbooks, and "patgbentries", which stores the actual guestbook entries. Here's a quick glance at the SQL commands to create these tables: Next up, configuration. patGuestbook configuration is handled via a single file named "patGuestbook.php", located in the source distribution's "config" directory. It's fairly self-explanatory, take a look: Most of this is pretty standard information - patGuestbook needs to know the database access parameters so that it can get to its tables, and the location of the directories containing screen templates for the guestbook administration module and the guestbook itself (these templates are used by the patTemplate engine to render each page of the application, and can be customized to your needs - more on this later). If you're using the default installation, you shouldn't need to change any of the information in this file, except the database access parameters. If, on the other hand, you're not using the default installation paths and are plan to integrate patGuestbook into your existing site structure, you should also alter the directory locations in the configuration file to reflect where the templates are located. You can now check to see if patGuestbook is up and running, by visiting the URL (remember to alter this as per the installation path on your system): http://localhost/patGuestbook/example.php patGuestbook should load up and display the following error message: No need to panic - this is just an indication that the application could not find any guestbook in the system. This is probably because you have not yet created one - but hey, at least it confirms that you've got my configuration right. Next, how about wiping out that error message by actually creating a guestbook?
blog comments powered by Disqus |