Grow your CSS skills. Land your dream job.

Need Advice – Random Content Generation

  • # July 11, 2009 at 9:13 pm

    Hi all,

    I’m looking to include a small section (div) of content that contains recommendations/testimonials my client has received. I would like this div to appear in the header of every page and anytime a user visits/refreshes a page on the site I would like it to display random content (from the recommendations). I can think of 2 ways to do this: PHP pulling from a database, and using jQuery to "auto-refresh" every so often. Is there another good way of doing this? I’m not sure what the best-practice would be for this kind of situation, as I’m a bit of a newcomer to web design. Any advice is GREATLY appreciated.
    [img]http://pennedweb.com/v2/images/web_question.gif[/img]

    # July 12, 2009 at 6:20 am

    I have a php script that shows testimonials on my site.

    I don’t care too much for it auto-refreshing while on the page, I just wanted it to be random at each page load.

    # July 12, 2009 at 1:01 pm

    I would go with the PHP approach, or you could use JavaScript with an array that randomly selects a number and passes it into the array and gets back a testimonial. If you wanted something that looks great and refreshes often why not go with a Flash approach, however as I said I would go with the PHP and database.

    # July 12, 2009 at 2:00 pm

    Thanks guys! I think I will go the PHP route.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".