...

View Full Version : Random order includes from directory



kindlekoma
06-15-2010, 10:17 PM
Hi all,

I'm new to these forums, and extremely new to php coding in general. My role is primarily a front-end developer (html / css) and a bit of php in the form of includes to manage recurring content and so forth.

My question is probably convoluted so if my thinking is flawed, please let me know.

I'm using a jquery content slider. It pulls from a <ul> and loads each <li> as an individual slide.

What I would like to do is use php includes for each <li> (some inline css, and html) and have them load in a random order using a single script.

Something like this...

<!--content slider begins-->
<ul>
<?php include("RANDOM-LOADER-SCRIPT.php"); ?>
</ul>
<!--content slider ends-->


Where RANDOM-LOADER-SCRIPT reads a directory of snippets (subfolder/snippet1.php, snippet2.php and so on) and includes ALL of them into the <ul> in a random order, without repeats.

Thanks much!

kindlekoma
06-15-2010, 10:47 PM
Thanks to Phoenix over on webforumz.com

http://webforumz.com/php/3237-random-order-of-content.htm



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum