spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / perl / xhoo / php1

Developer News
MicrosoftÂ’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0

phpHoo, Part I

Abstract

Jonathan Eisenzopf has done a great job showing how easy it can be to create a Yahoo like directory using Perl. perlHoo's elegant design makes for a very useful Web application that adds significant value to a Web site, while maintaining a high degree of simplicity and ease of maintenance.

Laurence Gold has shown us how easy it can be to create the same simplicity and elegance using ASP technology. Although the end results (perlHoo and Yahasp) are models of simplicity, they both have made design decisions that, ultimately, lead to the failure of both of these programs as viable long-term solution to the "Yahoo like directory" goal. This tutorial will address and solve these limitations by using PHP and a relational database. (MySQL). In part I of this tutorial, we'll start out with the basics of using MySQL with PHP, and create a program with the same functionality found in part II of the perlHoo tutorial. We'll also be adding a few new features.

Designing phpHoo

A program's initial design is probably the most critical phase of programming. When you sit down to write a program, you must take the time to design it correctly from the very beginning. Take a look at the design decisions of perlHoo and Yahasp.

The design criteria was as follows:

  1. Organizes information hierarchically
  2. Contains information about resources on the Internet
  3. Allows users to suggest new resources
  4. Allows editors to modify the directory content
  5. Is simple to maintain
  6. Takes less than 1 week to develop
  7. Exports and imports directory content from/to multiple sources
The perlHoo initial design solution to accomplish goal #1 was to create a directory and file structure, where each Category became a directory on the file system, and links were stored in text files. This solution is not scalable and is not feasible for sites with limited resources.
  1. Your provider may place a cap on the number of files you are allowed to have. (Quotas) The number of files and directories your programs require now become very important.
  2. Regardless of how the program is written or what language you use, file system access will always be the single most resource intensive operation in your program. Your program performance will be directly proportional to the number of file system calls it makes. The more files accessed by the program, the slower it gets. Guaranteed. Creating a program designed around file system calls is a recipe for disaster.
  3. The more useful your directory becomes (more categories with more links), the slower it will be. (More files and directories to search through)
And that is the magic word, isn't it? Search. Program design becomes even more important when you consider the ultimate goal of your program - to eventually implement some means of searching this directory for the information you want. Face it, Yahoo's site would be virtually useless without the ability to search it. Using flat-text files and dozens of directories are no longer viable options when you consider this goal.

phpHoo Download source | Try It
phpHoo is a PHP version of PerlHoo. It is a bit more advanced and requires the MySQL database.


home / experts / perl / xhoo / php1

http://www.internet.com

Produced by Jonathan Eisenzopf and

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Perl Pragma Primer · Implement Drag and Drop in Your Web Apps: Part 2 · How to Create an Ajax Autocomplete Text Field: Part 5
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE) · Vyatta: Downgrades that Pay Off · NetMotion Brings Cross-Network Support to Wireless VoIP


Created: July 20, 1999
Revised: July 20, 1999

URL: http://www.webreference.com/perl/xhoo/php1/