www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > PHP

    PHP Discussion and technical support for using and deploying PHP based websites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 05-29-2006, 12:20 PM
    Digitalicious Digitalicious is offline
    Registered User
     
    Join Date: May 2006
    Posts: 3
    Different Banner per URL

    I have a banner that needs to change when the URL changes. When the URL ends with ?page_id=2, I need it to be a special banner. When the URL is anything else, it needs to be another banner. Unfortunately, I'm no good with PHP; something that continues to haunt me. So I was wondering if anyone had a solution to this?
    Reply With Quote
      #2  
    Old 05-29-2006, 12:48 PM
    balloonbuffoon's Avatar
    balloonbuffoon balloonbuffoon is offline
    Registered User
     
    Join Date: Jan 2005
    Location: Illinois
    Posts: 818
    Try this:
    PHP Code:
    <?php
    $banner
    = ($_SERVER["QUERY_STRING"]=="page_id=2") ? "special_banner.gif" : "default_banner.gif";
    echo
    "<img src='$banner' alt='' />";
    ?>
    Put it where you want the banner to go, and replace special_banner.gif and default_banner.gif with your banner filenames.

    --Steve
    __________________
    Save The Shirts!
    Don't overuse exclamation marks!!!!!!
    Reply With Quote
      #3  
    Old 05-29-2006, 01:03 PM
    Digitalicious Digitalicious is offline
    Registered User
     
    Join Date: May 2006
    Posts: 3
    That'll do it. Thanks a bunch.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:39 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.