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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.