Technology Forums: FTA, Satellite, Cable, Home Media, Hardware & Computers
|  Home   |  Forums   |  News   |  Blog   |  

Go Back   Techwatch: Satellite TV forums, FTA, Cable, Hardware, & Tech forums > Online Computing > Web Development


 

Register Members List Search Today's Posts Mark Forums Read

Web Development Web development and programming - C++, PHP, ASP, Javascript, and related issues.

Reply
 
Thread Tools
Old 09-04-06, 01:08 PM   #1 (permalink)
Senior Member
 
Join Date: Jan 2006
Posts: 172
Thanks: 0
Thanked 0 Times in 0 Posts
Default Rotating Images

Does anyone know how to rotate images on same spot when webpage is refreshed. Can it be done by HTML coding or Javascript is needed to do it? Any help is appreciated.
__________________
Sufi
sufi is offline   Reply With Quote
Old 09-04-06, 08:43 PM   #2 (permalink)
Member
 
webmonkey's Avatar
 
Join Date: Apr 2006
Location: Tadley, Uk
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to webmonkey Send a message via MSN to webmonkey
Default

I made a script to do this a few weeks back, its in php and also the comments tell you how to add the instances where it says site 1 image thats the banner/button for site one and then the url and so on. Well here is is:
Quote:
<?php
srand( microtime() * 1000000);
$advertise = rand(1,3);
//After the rand decided how many youve got and the first and last number e.g got 3, 1,3
switch($advertise)
//you can add more just use the same format
{
case 1 : $banner="site 1 image url"; $url="site one address"; break;
case 2 : $banner="site 2 image url"; $url="site two address"; break;
case 3 : $banner="site 3 image url"; $url="site 3 address"; break;
}
$display = "<a href=\"$url\" target=\"_blank\"> ";
$display.= "<img src=\"$banner\" ";
$display.= "width=\"468\" height=\"60\" border=\"0\" >";
$display.="</a>";
echo($display);
?>
Let me say if you only have a few instances beware becuase the same may appear every couple of times you refresh.
__________________
X6 Core Tutorials [V1.1]
webmonkey is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


All times are GMT +1. The time now is 06:56 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.