Jump to content


Photo

text link rotating php script ?


  • Please log in to reply
1 reply to this topic

#1 the_chancellor

the_chancellor
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 22 March 2006 - 06:56 PM

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.

#2 micah1701

micah1701
  • Members
  • PipPipPip
  • Advanced Member
  • 613 posts
  • LocationEllington, CT USA

Posted 22 March 2006 - 07:39 PM

'um,

$currentServerTime = date("G"); //give current hour of day on server

if ($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>';

"Confidence in the face of risk."




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users