PHPBuilder - Revisited: Build Dynamic Pages With Search Engines in Mind Page 2



RSS Twitter
Articles Tricks And Hacks

Revisited: Build Dynamic Pages With Search Engines in Mind - Page 2

by: Tim Perdue
|
July 30, 2000

Removing the '?' and '&' from the URL string is a necessary first step, and it's sufficient for many tasks. However, you can take it further by having context-sensitve meta tags generated on the fly for every page.
When I build a site, I create a common library that is include on every page throughout the site. You can call this file shared.inc or whatever.
Shared.inc sets up the database for me, and, more importantly, contains a function call for the header and footer of the site.

<?php

//sample shared.inc file

//set up database connections
//any global variables for background 
//    colors or path names

function site_header($title) {

    
//contains common HTML
    //for the header

}

function 
site_footer() {

    
//contains common html 
    //for the footer

}

?>
You would then call site_header() and pass in the page title for each page. That's exactly how PHPBuilder works.
If you have an architecture like this, all of a sudden you can do some really slick things in site_header(). Not only can I create the standard HTML header/title/body tags, but I can create meta tags using the $title string.

« Previous Page
1
|
2
|
3
|
4
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Tim Perdue

Comment:



Comment:

(Maximum characters: 1200). You have characters left.