owbussey 0 Report post Posted December 27, 2006 I get this error when i go to the following url: gallery Fatal error: Call to undefined function: scandir() in /home/owbussey/public_html/New Folder (2)/functions.php on line 18I have been doing some research and it seems that the function scandir() is php 5. Is that correct? If it is how can I make it work on Xisto? I will post the code to the file. I do not know whether the error will be best seen in the context of all of the source code. Here is a link to a zip file download of the source code (I did not want to take up a lot of space with an entire page of source code): source code download Share this post Link to post Share on other sites
Sharn 0 Report post Posted December 27, 2006 Yeah - that's a php 5 command. So, there really isn't any way to make it work on Xisto. I'm sure they will switch to it when it's stable, though. Unless it's absolutely required to have it, you MAY be able to edit it out somehow. I'm not sure about that, though. You'll have more of a chance messing it up than making it work. Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted December 27, 2006 Yes, scandir() is a php5 function, but the same effect can be had by using opendir(), readdir(), etc. <?php$dir = "/tmp";$dh = opendir($dir);while (false !== ($filename = readdir($dh))) { $files[] = $filename;}sort($files);print_r($files);rsort($files);print_r($files);?> The scandir() only makes your code shorter and more efficient, but the php4 method is also effective. Share this post Link to post Share on other sites
electron 0 Report post Posted December 31, 2006 Welll here is a code that you can use to see all the files in a directory: <?phpif ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "$file\n"; } } closedir($handle);}?> Since you want only images(I assume this as you are using it for a photo gallery) you will need to make a few changes.Well this will work for all the files and also some sub-directories and its sub directories.To find only images you will need to use either the name of the file and its type to find the image files only.Hope this will help you in finding the thinhs you require.Have a good day. Share this post Link to post Share on other sites