Changing Web Banner for Different Pages of a Site?

ucmmac

New Member
Messages
4
Reaction score
0
Points
0
Hi, I joined x10hosting not too long ago, and i'm working on a website for a club at my school.

http://www.ucmmac.x10hosting.com/

Now, i've tried using the search function on how to do this. Needless to say, i had no such luck.

But i was wondering if it was possible at all to change the web banner on my site to a different banner for each page/tab for my site?

So for example, it would have that main banner. And then it on another tab on the site, like "About" or "Media Gallery," it would display a different banner.

Would gladly appreciate the help.
 

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
Code:
<!--At The Top of the Page-->
<?php
if ( ! $_REQUEST['p'] )
{
    $img = 'banner.png';
}
else
{
    $img = $_REQUEST['p'].'.png';
}
?>

<!--Your Banner-->
<img src="<?php echo $img; ?>" id="banner" />

<!--Your Tabs-->
<a href="#" onclick="javascript:document.getElementById('banner').src='banner.png'">Page</a>

or some modified version of this.
but this general idea should work.
 
Last edited:

ucmmac

New Member
Messages
4
Reaction score
0
Points
0
Do you mean a random banner or a specific one for each page?

Specific one for each page.
Edit:
Code:
<!--At The Top of the Page-->
<?php
if ( ! $_REQUEST['p'] )
{
    $img = 'banner.png';
}
else
{
    $img = $_REQUEST['p'].'.png';
}
?>

<!--Your Banner-->
<img src="<?php echo $img; ?>" id="banner" />

<!--Your Tabs-->
<a href="#" onclick="javascript:document.getElementById('banner').src='banner.png'">Page</a>
or some modified version of this.
but this general idea should work.

I sort of understand how the code works. But on my site, the image is placed inside a table.

Here's part of my code.

Code:
</style></head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table style="height: 100%;" border="0" cellspacing="0" cellpadding="0" align="center">
<tbody>
<tr>
<td width="171" height="110" align="center" background="http://xf9.xanga.com/ab3f63f331234248885187/w197416018.png">
<table style="width: 160px;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td class="logo" align="center"><span class="style1"><br /></span></td>
</tr>
</tbody>
</table>
</td>
[B]<td width="751" height="110" background="http://x18.xanga.com/ff1f70f311035248885115/w197415948.png">&nbsp;</td>[/B]
</tr>
<tr>
<td valign="top"><img src="http://xee.xanga.com/447f6aea47137248871589/w197403763.png" alt="" width="170" height="420" /></td>
<td valign="top">
<table style="width: 100%; height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<table style="width: 545px;" border="0" cellspacing="0" cellpadding="0" background="http://forums.x10hosting.com/images/e004_05.jpg">
<tbody>
<tr>
<td width="7"><img src="http://forums.x10hosting.com/images/e004_04.jpg" alt="" width="7" height="24" /></td>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
{%menu_start=1%}
<td class="menutop"><a href="{%menu_href%}">{%menu_display%}</a></td>
{%menu_end=1%}
</tr>
</tbody>
</table>
</td>
<td width="63"><img src="http://forums.x10hosting.com/images/e004_09.jpg" alt="" width="298" height="24" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td height="100%" valign="top">
<table style="width: 550px; height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="3" valign="bottom" background="http://forums.x10hosting.com/images/e004_11.jpg"><img src="http://forums.x10hosting.com/images/e004_16.jpg" alt="" width="3" height="214" /></td>
<td class="content" valign="top">
<p>{%content%}</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
in Bold is where the banner is, which is inside a constructed table in my layout design of the site. What i'm trying to do is have a different banner for each page.

So if i were to modify that code given above (or if there is any other code more suitable). How would i go about it to where the banner is changed inside that constructed table?
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Tables? Yech. (Dave Winer also has something to say about using tables for layout).

Is the header section reproduced in every page? Are you using templates? Are you using server side includes or scripting to include the header section?
 
Top