Random Links Script

Discussion in 'PHP' started by dalster44, Nov 27, 2007.

  1. #1
    Hi,

    Has anybody ever used a SSI Random Links rotator script in a CubeCart website?

    I'm trying to call the SSI but nothing is happening, also any ideas what command in the template I would use?

    Here's what I'm using:

    <?php include("phpadtext.php"); ?>

    with the actual script and text file in my root.

    Thanks
     
    dalster44, Nov 27, 2007 IP
  2. phpl33t

    phpl33t Banned

    Messages:
    456
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #2
    that isn't SSI dude, that's php. you are inclusing the file but not saying what to do with it once it is included. Here is what you are meaning to do...

    <?php
    require_once('phpadtext.php');
    echo $output_variable;
    exit;
    ?>



    But I prefer to do this. Create a php file of any name and put this into it:

    <?php
    srand((double)microtime()*1000000);
    $array_ad = spliti("BREAKBREAKBREAK",join('',file("./Hbanner.txt")));
    $Hbanner1 = $array_ad[rand(0,sizeof($array_ad)-1)];

    echo $Hbanner;
    ?>

    Now upload a textfile named Hbanner.txt and chmod it to 666. Now, Put in your ads/links and betweek each one, put the text BREAKBREAKBREAK like this:

    <a href="#">Ad number one</a>
    BREAKBREAKBREAK
    <a href="#">Ad number two</a>
    BREAKBREAKBREAK
    <a href="#">Ad number three</a>
     
    phpl33t, Nov 27, 2007 IP
  3. dalster44

    dalster44 Active Member

    Messages:
    722
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks for helping a php noob :), I'll give this a try.
     
    dalster44, Nov 28, 2007 IP