![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Hardware Tech Team
|
change picture
Hey guys I was windering if anyone knew of a way, with out flash, to make an image change when someone refreshes a page. I have four images that I would like to rotate everytime someone visits the page. Thanks.
__________________
![]() "If it's really a supercomputer, how come the bullets don't bounce off when I shoot it ?" <<PC Pitstop>><< AVG Free>><<Spybot>><<Everest 2.0>><<Trend Micro House Call>><<HijackThis How-to>> |
|
|
|
| Sponsored Links |
|
|
#3 (permalink) |
|
Design Team
|
I know of a javascript code from javascript.internet.com and I know of a PHP script that uses cases.
Here is the one I recommend (php): HTML Code:
<?php
srand( microtime() * 1000000 );
$num = rand( 1, 3 );
// change the 4 to the total number of ads you have
switch( $num )
{
// These are the banners
case 1 : $img="image url"; $url="link url"; break;
case 2 : $img="image url"; $url="link url"; break;
case 3 : $img="image url"; $url="link url"; break;
// for another ad just copy one of the above code and change the 4 in rand( 1, 4)
}
// This is the output script
$banner = "<center><a href=\"$url\" target='_blank' alt='Advertisement'> ";
$banner.= "<img src=\"$img\" ";
$banner.="border=\"0\" alt=\"Click me!\"></center>";
$banner.="</a>";
echo( $banner );
?>
__________________
![]() Nvu || Notepad++ || Apache || PHP || Keep TSF Alive "The great thing about a computer notebook is that no matter how much you stuff into it, it doesn't get bigger or heavier." |
|
|
|
![]() |
| Thread Tools | |
|
|