+ Reply to Thread
Results 1 to 5 of 5

Thread: Changing Web Banner for Different Pages of a Site?

  1. #1
    ucmmac is offline x10Hosting Member ucmmac is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    4

    Exclamation Changing Web Banner for Different Pages of a Site?

    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.

  2. #2
    zapzack is offline x10 Elder zapzack is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    606

    Re: Changing Web Banner for Different Pages of a Site?

    Do you mean a random banner or a specific one for each page?

  3. #3
    kbjradmin's Avatar
    kbjradmin is offline x10 Elder kbjradmin is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Washington State, USA
    Posts
    512

    Re: Changing Web Banner for Different Pages of a Site?

    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 by kbjradmin; 07-23-2009 at 07:44 PM.

  4. #4
    ucmmac is offline x10Hosting Member ucmmac is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    4

    Re: Changing Web Banner for Different Pages of a Site?

    Quote Originally Posted by zapzack View Post
    Do you mean a random banner or a specific one for each page?
    Specific one for each page.
    Edit:
    Quote Originally Posted by kbjradmin View Post
    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>
    <td width="751" height="110" background="http://x18.xanga.com/ff1f70f311035248885115/w197415948.png">&nbsp;</td>
    </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 by ucmmac; 07-25-2009 at 04:49 PM. Reason: Automerged Doublepost

  5. #5
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Changing Web Banner for Different Pages of a Site?

    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?
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. review my site
    By scummerz in forum Review My Site
    Replies: 24
    Last Post: 01-24-2009, 02:50 PM
  2. Replies: 0
    Last Post: 01-04-2009, 11:28 AM
  3. BandWidth Explained
    By teclanka in forum Tutorials
    Replies: 9
    Last Post: 10-13-2008, 07:47 AM
  4. [Offer][100 credits] selling footer banner on site
    By kjl00 in forum The Marketplace
    Replies: 0
    Last Post: 09-15-2008, 01:13 PM
  5. [REQ][400 credits]create banner for my site
    By edu2004eu in forum The Marketplace
    Replies: 6
    Last Post: 09-09-2008, 05:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers