On 14 Jan 2004 at 21:16, Freedomware wrote:

> Suppose you design a standard banner for the top of your web pages and 
> use an include to insert it into every page on your site, like this:
> 
> <?php
> include ("../../../../includes/header.php");
> ?>
> 
> But you later decide you'd like to change just one element on each page. 
> For example, you might design a standard image banner, followed by a 
> title and subtitle for each page, but you want to change the title to 
> Alaska, Nebraska or Wyoming on each page.
> 
> Is there a way to do this with PHP? If it has a name, I can search for 
> information online, but I don't even know what to call it.
> 
> I've played with something of this nature in Dreamweaver. You can design 
> a template that turns out carbon copies of a page, but single out 
> certain items by enclosing them with @@, which are somehow changed on 
> individual pages, or something like that. I can't remember what it's 
> called at the moment.
> 
> Another strategy would be to use a PHP include to insert an element on 
> different pages, then modify each element with a unique style sheet on 
> each page.
> 
> But I just wondered if PHP offers additional possibilities for similar 
> experiments.
> 
> Thanks.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
Hi 

A possible option  could be something like  this 

{calling_template.php}

<?php
        /*State name does not have to be set statically, can be set from SQL query 
etc*/

        $statename = 'Alaska';

        include('/path/header.inc');

?>

{header.inc}

<?php

        echo "Welcome to the great state of ".$statename."....now go home!"

?>

That way you can put whatever you want as the statenameat the top of your pages, and 
the header willalways reflect it. You could also do something similar with objects 
e.g. 

<?php

        include('header.inc');

        this_page_head = new header('Alaska')

?>

if you are that way inclined.

Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
"There are 10 kinds of people in this world, 
those who understand binary and those who don't" (Unknown)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to