Jump to content

Archived

This topic is now archived and is closed to further replies.

arkansasdj

Simple SubHead Img Replacement Question

Recommended Posts

[!--fonto:Verdana--][span style=\"font-family:Verdana\"][!--/fonto--]Ok so I am finaly getting around to learning a little PHP since I'm having some trouble geting ASP to run on my server.

I'm trying to figure out how to do a simple Else statment to set in my top include file so that they page will dynamicly pull the correct header image for each interior page. I've searched the data base here and can't find anything that specificly addresses this particular configuration.

thanks in advance.

Jason

[!--fontc--][/span][!--/fontc--]

Share this post


Link to post
Share on other sites
Assuming each page is 'identifiable', then look at the switch() function. Simple tutuorial - [a href=\"http://www.plus2net.com/php_tutorial/php_switch.php\" target=\"_blank\"]http://www.plus2net.com/php_tutorial/php_switch.php[/a]

Share this post


Link to post
Share on other sites
What I am looking for is something that will take my header images and change them out based on which interior page is loaded.

for instance if

www.earonfloor.com/balance had a specific header image and www.earonfloor.com/events had a diffrent header image. I would like to have these header rules included in my int_top.php include file.

I've hear rumors that this can be done with CSS. Any truth to that? I'd really like to see an example of a php solution though.

Share this post


Link to post
Share on other sites
um, that was exactly what I gave you. [b]IF[/b] the page is identifiable, then you can switch the header image.

Trivial example, imagine that events.php looks like this:
[code]<?php
$page = "events"; // identifies specific page
$page_css = "events.css"; // small specific css file
include("top.php"); // your normal page top stuff but see below
[/code]
And then you need to use a specific CSS file that only defines the header background image. For example, events.css:
[code].header {
background:url('../images/events.jpg') bottom left no-repeat;
}[/code]
Somewhere (presumably in your top.php file) is where the page-specific header definition gets used
[code]<link rel="stylesheet" href="<?php echo $page_css;?>" type="text/css">
[/code]

That's the general idea.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.