I have a PHP function that calls for the file names in a directory. That all works perfectly fine. The code is below:
Code: Select all
<?php
$string="";
$fileCount=0;
$filePath=$PATH.(TEMPLATEPATH . '/'); # Specify the path you want to look in.
$dir = opendir($filePath); # Open the path
while ($file = readdir($dir)) {
if (eregi("\.php",$file)) { # Look at only files with a .php extension
$string .= "$file,<br />";
$fileCount++;
}
}
if ($fileCount > 0) {
echo sprintf($string,$fileCount);
}
?>Code: Select all
<?php foreach ($file['options'] as $option) { ?><option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?></select>I can get the two features working side by side, but cannot bring them together. Im tearing my hair out here with this and I havent got much hair to start with!
Could anyone possibly help, im really stuck on this one.
Thanks if anyone can help! Feel free to say if I havent explained myself very well.