Jump to content

random banners.


redarrow

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]
Link to comment
https://forums.phpfreaks.com/topic/12986-random-banners/
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.
Link to comment
https://forums.phpfreaks.com/topic/12986-random-banners/#findComment-49941
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?
Link to comment
https://forums.phpfreaks.com/topic/12986-random-banners/#findComment-50054
Share on other sites

Archived

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

×
×
  • Create New...

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.