It's called 'Register Globals' Basically, rather than having $DOCUMENT_ROOT, all the preset variables are stored in 'Super arrays'. This means you will now have to use $_SERVER["DOCUMENT_ROOT"]
For more information: http://www.php.net/manual/en/security.registerglobals.php Use phpinfo(32); to list all variables in a script, quite a good debug tool Stephen ----- Original Message ----- From: "christopher calicott" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 06, 2002 3:02 AM Subject: [PHP-WIN] hello there. > 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 > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php