I've got a script that is installed on a Solaris machine that is having 
difficulties, and I'm wondering if anyone can help.

The script is trying to access and read files within a directory, pull some 
at random and put them in a webpage.

The path is correct, the directory is set to 755 and I can view the files 
when I browse in. The script is up and running perfectly on two other 
servers - one on Red Hat Linux and one on Win2k.

The script is this:
// This pulls 3 random banners from the appropriate
// subdirectory of the images section of the site
if ($banners != FALSE) {
while (($file = readdir($banners)) != FALSE)
    if ($file != "." && $file != "..") $banner_list[$i++]=$file;
if ($l!=0) {
for ($i=0;$i<3;$i++) {
   if (empty($ad)) { $i-=1; continue; }
   echo "
    <div class='sidebar-banner-slot'>
     <a href='$SECTION_URL"."ad-clickthrough.htm?AD_URL=$link'><img src='".
     "/$ad' height='$imginfo[1]' width='$imginfo[0]' border='0' alt='Visit
$link' /></a>
} // $l != 0
} // $banner != FALSE

The problem on the solaris machine is that opendir is getting in to the
directory but from that point the server won't let the script read the
files. It kicks back the error:

Warning: 1 is not a valid Directory resource in
on line 20
(Identifying directories are foo'd out)

Since it kicks back the "1" and not a false, it seems it's getting access
but then not being permitted. Here's something else  - the problem is
intermittent: sometimes the script can grab the images and others not.

Can anyone help?

Many thanks in advance.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to