Results 1 to 4 of 4

Thread: question about headers

  1. #1
    Join Date
    Jan 2008
    Posts
    2

    Default question about headers

    i've modified the header.html file in the template directory to include an advert... this advert is on all pages of the site.

    what is the easiest way to only show this advert on the main (index) page and not the entire site?

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    If you only want it to display on the index then the easiest thing to do is only add it to index.html

    Your alternative is to add it to the header and then try and make some code so that ad will only display when a user visits the index page. No idea what code you'd use, but it should be possible.

  3. #3
    Join Date
    Jan 2008
    Posts
    2

    Default Solution

    Solution using code:

    Just used php to find out the current url, and then if it matches the default entrance page of the site to display the advert.

    <%php%>

    $url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];

    if ($url == 'http://www.website.com/') { echo '<img src="http://www.website.com/themes/default/images/advert.jpg>'; }

    <%/php%>

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Very nice

Similar Threads

  1. Replies: 2
    Last Post: 03-27-2006, 10:46 AM
  2. Headers Already Sent (Can't fix)
    By andmunn in forum v5.x
    Replies: 6
    Last Post: 03-23-2005, 09:24 PM
  3. PHP Integration - Php Headers
    By brickholius in forum Pre-Sales Questions
    Replies: 2
    Last Post: 10-19-2004, 03:00 PM
  4. headers already sent by....
    By affiliateguide in forum v5.x
    Replies: 0
    Last Post: 07-13-2004, 03:29 PM
  5. Duplicate Headers?
    By Hart_House in forum v5.x
    Replies: 1
    Last Post: 09-25-2003, 05:49 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
  •