1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can someone Explain where to insert this banner rotater code?

Discussion in 'PHP & Perl' started by ycfme, Dec 30, 2010.

  1. ycfme

    ycfme Power Member

    Joined:
    Mar 24, 2010
    Messages:
    779
    Likes Received:
    65
    I'm thinking of using this banner rotator script :
    HTML:
    http://www.pro-dezign.com/how-to-php-banner-rotator.html
    I'm clear where this should go:
    PHP:
    <?php include ("banner-rotator.php"); ?>
    I am not however clear where to insert this code:

    PHP:
    <?php
    $Img1 
    "http://www.(the source of the image)";
    $Alt1 "[advertisement] (place your alt text here)";
    $Url1 "http://www. (the url of the link)";

    $Img2 ="http://www.pro-dezign.com/images/banner.jpg";
    $Alt2 "[advertisement] pro-dezign web development";
    $Url2 "http://www.pro-dezign.com/index.html";

    $num rand (1,2);

    $Image = ${'Img'.$num};
    $Alt = ${'Alt' .$num};
    $URL = ${'Url'.$num};

    Print 
    "<a href=\"".$URL."\"><img src=\"".$Image."\" alt=\"".$Alt."\" /</a>"; ?        >


    Also what does this line do?
    PHP:
    <a href=\"".$URL."\"><img src=\"".$Image."\" alt=\"".$Alt."\" /</a>"; ? 

    Thanks!
     
    Last edited: Dec 30, 2010
  2. f0rked

    f0rked Registered Member

    Joined:
    Jan 25, 2009
    Messages:
    71
    Likes Received:
    64
    PHP:
    Print "<a href=\"".$URL."\"><img src=\"".$Image."\" alt=\"".$Alt."\" /</a>"; ?        >
    This would go where you want the banner displayed.

    PHP:
    <a href=\"".$URL."\"><img src=\"".$Image."\" alt=\"".$Alt."\" /</a>"; ? 
    This is the actual part of the code that would display the banner. Using the above image link/linking url/alt tag.