Rotate Between HTML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ccmovies
Forum Newbie
Posts: 15
Joined: Mon Oct 11, 2010 9:14 pm

Rotate Between HTML

Post by ccmovies »

I am making a testimonial area and I want it to rotate between different quotes with the refresh of the page. How can I do this? I was thinking something to do with the PHP random code, but I am not very good with PHP so I wasn't sure. Thanks!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Rotate Between HTML

Post by requinix »

Random != rotating. If you want random then that's pretty easy, but if you want rotating then you need to keep track of the previous testimonial and show the next one in the list.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Rotate Between HTML

Post by Jonah Bron »

You'll have to be more specific on how you have it set up so far. Do you have your testimonials stored in a database already?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Rotate Between HTML

Post by s.dot »

Fill an array with testimonials, shuffle() it, and pick a key.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply