Jump to content

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--]
Link to comment
https://forums.phpfreaks.com/topic/8795-simple-subhead-img-replacement-question/
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.
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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.