spacer

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

home / experts / perl / xhoo / php1

Developer News
Microsoft Shows Some Ankle With Visual Studio
Gentoo Linux Cancels Distribution
It's Official: Windows 7 at PDC, WinHEC

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
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Controllers: Programming Application Logic - Part 2 · How to Use JavaScript to Validate Form Data · Controllers: Programming Application Logic
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Sprint Launches Mobile WiMAX Network · Albatron Downsizes with the KI780G Mini-ITX Motherboard · Can't Find a Wi-Fi Network? Make Your Own.


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

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