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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using opendir() with a variable

Status
Not open for further replies.

flea333

Technical User
Sep 4, 2003
47
US
I am trying to pass a variable directory name to a script but it seems to just open the root directory on the server. Why won't this work:
opendir('/'.$gallery.'/')

But this does when I specify the string in the code:
opendir('/directory/');

Is the variable somehow not a string or something? I pass the variable in the url, ie. dir=directory.
 
There is no reason why you can't use a variable with opendir(). The most likely culprit is that $gallery does not contain the value you think it does.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top