Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using opendir() in PHP3

Status
Not open for further replies.

flea333

Technical User
Sep 4, 2003
47
0
0
US
I am passing a varialbe to opendir, I want to send the directory through the url. My server does not seem to process the variable as a string or something though. When I type in the name of the directory it reads it. What is going on? The code that doesn't work is:
$dir = "./".$gallery."/";
if ($handle = opendir($dir))

All that does is load the current directory (just the ./ part). However $gallery is a string passed through the url that has a directory 'vh' but it wont read it. When I replace the $gallery varialbe wiht my folder name as a static string, it reads the folder. What's going on?
 
Are the proper permissions set for the directory?

Try using is_dir in conjunction with open_dir. This may help you debug the problem.

*cLFlaVA
----------------------------
A polar bear walks into a bar and says, "Can I have a ... beer?"
The bartender asks, "What's with the big pause?
 
Just out of curiosity:
Did you really mean PHP3?
If so, man/woman, it's time to upgrade. If not, please provide the current version you are using.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top