PDA

View Full Version : image with link rotating script


pro1016
September 7th, 2007, 07:09 AM
im looking to add a section on my page.

would like to have a image section that displays random images with links, images would change on page reload.

does anyone have some PHP coding they could send me or direct me in the right place.

thank you

nina
September 8th, 2007, 08:49 PM
If you still need help, i could probably help you.
i have a code like this on my site.
pm me.

minnseoelite
September 8th, 2007, 08:58 PM
If you have Dreamweaver there is a plug in that will do this automatically, you just tell it what folder to look in and where to link the images to and it will generate the code for you.

xJennax
September 8th, 2007, 09:34 PM
I had a rotation script for banners on my site, here it is...sorry if thats not what you're looking for.


<script language="JavaScript">

<!-- Begin
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="http://www.SITE1.com";
alt="IMAGE ALT HERE";
banner="http://SITE1.com/.jpg";
width="468";
height="60";
}
if (ad==2) {
url="http://www.SITE2.com";
alt="IMAGE ALT HERE";
banner="http://www.SITE1.com/banner2.jpg";
width="468";
height="60";
}
if (ad==3) {
url="http://www.SITE3.com";
alt="IMAGE ALT";
banner="http://SITE3.com/banner3.jpg";
width="468";
height="60";
}


document.write('<a href=\"' + url + '\" target=\"_blank\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0></a>');
// End -->
</script>

Incognito
September 9th, 2007, 12:03 AM
http://www.dyn-web.com/javascript/rotate-img/rotate-rand.html
http://www.communitymx.com/content/article.cfm?cid=651FF
http://www.alistapart.com/articles/randomizer/

pro1016
September 9th, 2007, 04:33 PM
If you have Dreamweaver there is a plug in that will do this automatically, you just tell it what folder to look in and where to link the images to and it will generate the code for you.

yes thats what i use, i never knew this, im gonna search for it now. thank you

pro1016
September 9th, 2007, 04:37 PM
I had a rotation script for banners on my site, here it is...sorry if thats not what you're looking for.

thank you jenna, i want to stay with PHP rather than JS. ill test it out anyways and see how it is. thanks

pro1016
September 10th, 2007, 06:38 AM
i came across this script. pretty sure this is what i was looking for, ill have to try it out.

http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm