Jump to content

Archived

This topic is now archived and is closed to further replies.

redarrow

random banners.

Recommended Posts


I am curently learning how to get random images from an array i done that

but is there a way to get the image to change every hour with time() .




[code]

<?php

$banner[]="<img src='name.gif'></img>";
$banner[]="<img src='name.gif'></img>";
$banner[]="<img src='name.gif'></img>";

srand( (double) microtime() * 10000000);

$banners= array_rand($banner);

echo "<html><body bgcolor='blue'><br>$banner[$banners]<br></body></html>";


?>
[/code]

Share this post


Link to post
Share on other sites
Here is a script that does just that using a cookie. It is easier for me to link you than try to explain it.

[a href=\"http://www.clarksco.com/blog/?p=10\" target=\"_blank\"]http://www.clarksco.com/blog/?p=10[/a]

Share this post


Link to post
Share on other sites
[!--quoteo(post=388349:date=Jun 27 2006, 04:06 AM:name=phpstuck)--][div class=\'quotetop\']QUOTE(phpstuck @ Jun 27 2006, 04:06 AM) [snapback]388349[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Here is a script that does just that using a cookie. It is easier for me to link you than try to explain it.

[a href=\"http://www.clarksco.com/blog/?p=10\" target=\"_blank\"]http://www.clarksco.com/blog/?p=10[/a]
[/quote]

thank you but a tutoral would be better to learn but thanks.

Share this post


Link to post
Share on other sites
how do you do this please cheers


if($time_know){

echo image

}else{

if ($time_know+5 mins){

echo diffrent image

on

on

on


So a picture will show diffrent according to the time diffrence can not work it out

Share this post


Link to post
Share on other sites
[!--quoteo(post=388373:date=Jun 27 2006, 01:26 AM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Jun 27 2006, 01:26 AM) [snapback]388373[/snapback][/div][div class=\'quotemain\'][!--quotec--]
how do you do this please cheers ... So a picture will show diffrent according to the time diffrence can not work it out
[/quote]
Even with your pseudo-code example, I can't begin to understand what you want to do. Can you explain (in words) in more detail how you want this to work. Are you interested in the time or the time since something happened?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.