the_chancellor Posted March 22, 2006 Share Posted March 22, 2006 Greetings, I have been searching for a php script. Let me explain below ; I have several text links (urls) to be rotated on my site. The script should rotate those links automatically accoring to my hosting service's server time. For instance, the text link on my site will be www.yahoo.com between 00am to 03am, and then will turn to www.google.com between 03am to 1pm, and then will turn to www.phpfreaks.com between 1pm to 8:30pm, and will turn to www.phpbb.com between 8:30pm to 00am ..... etc. Let me tell you onces again that the time is "SERVER TIME". Could anyone help me about this script? Is it too custom or can i find an anonymous script on the net? Thank you all. Quote Link to comment https://forums.phpfreaks.com/topic/5521-text-link-rotating-php-script/ Share on other sites More sharing options...
micah1701 Posted March 22, 2006 Share Posted March 22, 2006 'um,$currentServerTime = date("G"); //give current hour of day on serverif ($currentServerTime < 6) { echo '<a href="http://www.yahoo.com" title="go to yahoo">Yahoo!</a>'; }elseif ($currentServerTime < 12){ echo '<a href="http://www.site1.com">site2</a>'; }elseif ($currentServerTime < 18){ echo '<a href="http://www.site3.com">site3</a>'; }else{ echo '<a href="http://www.site4.com">site4</a>'; Quote Link to comment https://forums.phpfreaks.com/topic/5521-text-link-rotating-php-script/#findComment-19729 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.