I have a script in a website that I was working on about a year ago.. it was working when I left off. I had a hard drive crash and then subsequently got REALLY sidetracked and I am just getting back around to finishing the design of the site and adding new content so I can publish it.
The thing is, when I reinstalled the latest Apache and PHP the other day... the script is suddenly not working. Apparently something has changed between the older and the newer versions that's killed the script. It is a really simple one. It looks in a directory where there are images all of the same size, grabs one at random and sticks it in a table in my html document. this just gives the appearance of a little dynamics to the website. Like I said, it was working great before, but now - nada. (btw I am on Windows 2000 here) here are the errors I am getting: Warning: OpenDir: Invalid argument (errno 22) in c:\wwwroot\includes\menu_bar.php on line 5 Fatal error: Call to a member function on a non-object in c:\wwwroot\includes\menu_bar.php on line 6 below is the script and the image line that places the image in the document: <? $strRealPath = "$DOCUMENT_ROOT/images/random_gen/"; //$DOCUMENT_ROOT.dirname($SCRIPT_NAME)."/"; $handle = dir($strRealPath); while ($strFilename = $handle->read()) { if ( ($strFilename != ".") && ($strFilename != "..") ) { $aryFileNames[] = $strFilename; } } $strPicFile = $aryFileNames[Rand(0,count($aryFileNames)-1)]; ?> <IMG SRC="/images/random_gen/<?=$strPicFile?>" BORDER=0 alt=""><br> Does anyone have any ideas what might be the problem? -=- christopher -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php