redarrow Posted June 27, 2006 Share Posted June 27, 2006 I am curently learning how to get random images from an array i done thatbut 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] Quote Link to comment https://forums.phpfreaks.com/topic/12986-random-banners/ Share on other sites More sharing options...
phpstuck Posted June 27, 2006 Share Posted June 27, 2006 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 Link to comment https://forums.phpfreaks.com/topic/12986-random-banners/#findComment-49938 Share on other sites More sharing options...
redarrow Posted June 27, 2006 Author Share Posted June 27, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/12986-random-banners/#findComment-49941 Share on other sites More sharing options...
redarrow Posted June 27, 2006 Author Share Posted June 27, 2006 how do you do this please cheersif($time_know){echo image}else{if ($time_know+5 mins){echo diffrent imageonononSo a picture will show diffrent according to the time diffrence can not work it out Quote Link to comment https://forums.phpfreaks.com/topic/12986-random-banners/#findComment-49961 Share on other sites More sharing options...
AndyB Posted June 27, 2006 Share Posted June 27, 2006 [!--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? Quote Link to comment https://forums.phpfreaks.com/topic/12986-random-banners/#findComment-50054 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.