dudeking
January 23rd, 2007, 07:12 PM
I have been trying to edit a script buzz helped me with a while back so I can just include the file that is listed first alphabetically in a directory.
<?php
$dh = opendir("stories/");
$count='0';
while ($entry = readdir($dh)) {
if ((strpos($entry,'.php') !== false) && ($entry!=='index.php')) {
if ($count >= '1' ) {
include('stories/'.$entry);
}
$count++;
}
}
closedir($dh);
?>
Well to cut it short, it doesn't work lol
<?php
$dh = opendir("stories/");
$count='0';
while ($entry = readdir($dh)) {
if ((strpos($entry,'.php') !== false) && ($entry!=='index.php')) {
if ($count >= '1' ) {
include('stories/'.$entry);
}
$count++;
}
}
closedir($dh);
?>
Well to cut it short, it doesn't work lol