A web site question
Discussion
I want to add a small number of rotating ads to the front page of my web site.
There are two locations and I want to generate a number of different ads to appear in them, but changing to a different one each time the page is refreshed or re loaded.
Design is done using Dreamweaver (very early version) and I am happy to drop in a bit of hard code if needed.
But what code do I need, based on gif graphics call ad1, ad2, ad3 and ad4 etc.
Chris
There are two locations and I want to generate a number of different ads to appear in them, but changing to a different one each time the page is refreshed or re loaded.
Design is done using Dreamweaver (very early version) and I am happy to drop in a bit of hard code if needed.
But what code do I need, based on gif graphics call ad1, ad2, ad3 and ad4 etc.
Chris
Database to store the ad location, bit of php or javascript or similar to generate either a random number or fetchnext in a list on last used date/time order.
There are a load of plugins available for ad management.
Check out www.hotscripts.com
There are a load of plugins available for ad management.
Check out www.hotscripts.com
quickest and easiest way would be to do some scripting, be it server side or client side. All you need to do is create a number of images, numbered consectively between two parameters (0 and 10 for example) and then generate a "random" number between these extremes and display the picture. It's a doddle to do in PHP / ASP and easy enough in Javascript although you are relying on the users having javascript working...
Edited by docevi1 on Wednesday 9th August 18:08
JamieBeeston said:
Rotaging Image said:
<?php
$files = glob('{*.jpg,*.gif,*.png}', GLOB_BRACE);
header("Location: {$files[array_rand($files, 1)]}"
; ?>
Stick that in a directory with some images in and it will show a random one each time.
J
.....and how would I change that script to show the newest pic in the directory ?
[/threadhijack]
philthy said:
JamieBeeston said:
Rotaging Image said:
<?php
$files = glob('{*.jpg,*.gif,*.png}', GLOB_BRACE);
header("Location: {$files[array_rand($files, 1)]}"
; ?>
Stick that in a directory with some images in and it will show a random one each time.
J
.....and how would I change that script to show the newest pic in the directory ?
[/threadhijack]
I'm not a coder really, but you could sort a grep / awk / ls -lart command to display the latest.. or.. simply make the latest picture a higher number than the previous one and make an array to sort them into ascending order..
as I say, I'm no coder tho thankfully

Plotloss said:
philthy said:
I was with you all the way up to "you could code sort", then it got away from me 

Check out the ad management scripts on the aforementioned hotscripts.com
Makes it all very easy, you just download and install.
Cheers Plotloss, any in particular you recommend? I actually want to display a webcam pic with it, and the latest would obviously be best.
Looking at the moment....
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


