« singular forms | Main | camoto »

php code

i have this bit of code i'm stuck on, perhaps some good soul out there can see what I'm doing wrong?

I have this directory, where X number of include files reside. This code, loads X number of include files and displays them randomly. The X variable is not defined in the code, but picked up from the directory itself. So the code is successfully loading the folder, however is not displaying them randomly.

Any thoughts? Seems so simple, but I feel at a loss.

<?php $filedir = "photographers"; //The file folder


$i=0;

$handle = opendir($filedir);

while (false !==($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
include("$filedir/$file");
++$i;
}
}

closedir($handle);
?>

TrackBack

TrackBack URL for this entry:
http://www.mediafactured.com/mt/mt-tb.cgi/255

Listed below are links to weblogs that reference php code:

» hardcore xxx from hardcore xxx
hardcore xxx [Read More]

» teen bondage porn from teen bondage porn
teen bondage porn [Read More]

» boob job porn from boob job porn
boob job porn [Read More]

» rockstar inxs host nude from rockstar inxs host nude
rockstar inxs host nude [Read More]

» lily thai anal from lily thai anal
lily thai anal [Read More]

» blow job photos from blow job photos
blow job photos [Read More]

» shemales with big cock from shemales with big cock
shemales with big cock [Read More]

» hot hentai sex from hot hentai sex
hot hentai sex [Read More]

» free bi gay porno videos from free bi gay porno videos
free bi gay porno videos [Read More]

» wife creampie videos from wife creampie videos
wife creampie videos [Read More]

» fivesome black lesbian sex from fivesome black lesbian sex
fivesome black lesbian sex [Read More]

» uniform advantage from uniform advantage
uniform advantage [Read More]

» gay latino males fucking from gay latino males fucking
gay latino males fucking [Read More]

» girl having anal sex from girl having anal sex
girl having anal sex [Read More]

» Terry bradshaw paxil ad. from Paxil.
Paxil withdrawl. Paxil. [Read More]

Comments (1)

Well, I'm not a php expert (so I'm not going to catch you on syntax errors), but I suspect you're not giving us enough information.

What is the value of $i after this loop? Perhaps it's being set correctly, but you're not using the value correctly with the rand call?

Post a comment


posting a comment will display an error - but the comment will still be received. mt4 beta bug.

Please enter the letter "z" in the field below:

About

Neil Epstein is a designer in new york city. He can be reached .
Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 4.1