Random number in URL for ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • flip
    New Member
    • Jun 2007
    • 26
    • 3.6.x

    Random number in URL for ad

    I've done a LOT of searching and have come up with no simple answer for this problem.

    Basically I use a seperate app to rotate banners on the top of my site which requires you to add a random number into the URL so that peoples browsers don't cache the image and display the same one.

    My question is, in my header code, how would I add a variable to display a random number in the ad url?? I would like to think theres a simple feature already in VB that can do this since it is so robust...

    Any ideas?

    Here is my code to insert the ad:

    Code:
    <a href='http://ads.blah.com/www/delivery/ck.php?n=a86eebef&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.blah.com/www/delivery/avw.php?zoneid=1&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a86eebef' border='0' alt='' /></a>
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Try this:

    Code:
    <img src='http://ads.blah.com/www/delivery/avw.php?zoneid=1&amp;cb=[color=red]<if condition="$randomvar = TIMENOW">$randomvar</if>[/color]&amp;n=a86eebef' border='0' alt='' />
    That will use the current timestamp as the random number.

    Comment

    • flip
      New Member
      • Jun 2007
      • 26
      • 3.6.x

      #3
      Originally posted by Jake Bunce
      Try this:

      Code:
      <img src='http://ads.blah.com/www/delivery/avw.php?zoneid=1&amp;cb=[COLOR=red]<if condition="$randomvar = TIMENOW">$randomvar</if>[/COLOR]&amp;n=a86eebef' border='0' alt='' />
      That will use the current timestamp as the random number.
      You guys are awesome! That works just great...

      Thanks!

      Comment

      • motowebmaster
        Senior Member
        • Mar 2006
        • 255
        • 3.5.x

        #4
        Many thanks for this, I was looking for the exact same solution.
        Shawn

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...