Site Navigation with PHP
 
SEARCH: webmonkey  the web

 
PHP
-------------------------
Print
this article for free. 
-------------------------

Pages:
1  Why PHP?
2 The Alternatives
3 The PHP Way
4 All Together Now
5 Another Example
6 The Settings
7 Secrets Revealed
8 What Am I Looking At?
9 Bring It on Home

Site Navigation with PHP
by Brad Bulger 16 Jun 1999

Brad Bulger [an error occurred while processing this directive]has done many things for Wired over the years that he'd rather not go into right now. He wants to know when the future is going to get here.

Page 1

You may already know that PHP is a great language for making database-driven sites. But what else can you do with it?

All kinds of things. One glance at the manual's table of contents will tell you that.

The most immediate use for PHP is to let you put logic into your HTML. Should I include fragment A or fragment B? What if someone looks at my page with a browser that doesn't support frames? As you may have read elsewhere, you can use eXtended server-side includes (XSSI) to solve some of these problems. But XSSI is extremely limited: It can provide if-thens with some pattern matching, access to environment variables, string concatenation, and file includes. That's it.

PHP gives you all the tools you'd expect from a programming language: for and while loops, math operators (adding, subtracting — you know, math), and so on. You can also include files in two ways: directly or as a request to the server. In XSSI, all your includes are server requests. So using PHP can cut down on the number of hits a single page generates. Already you're saving money!

But wait, there's more. Much more. Let's look at a couple of examples of how PHP can be used for site navigation.

next page»