acroporas Posted September 27, 2006 Share Posted September 27, 2006 I'm trying to figure out how to control which folder the glob( function looks at? (I've noticed that it does not allways search the same folder that the php file calling the function is in.) Is there a website that goes into more detail about the funtions than what is found in the php manual.Also, is there a better way to get the list of files in a folder that is more easily controlable?ThanksWill Quote Link to comment Share on other sites More sharing options...
acroporas Posted September 27, 2006 Author Share Posted September 27, 2006 Anyone? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted September 27, 2006 Share Posted September 27, 2006 I've never had a problem using the glob() function. What problems are you having?Do you have code samples you can post?Ken Quote Link to comment Share on other sites More sharing options...
acroporas Posted September 28, 2006 Author Share Posted September 28, 2006 It is difficult to post code snippets as the problem is not in just one line but I can explain one example of what I call 'hard to control' I have the following file system.home directory header.php child directory 1 page.php child directory 2 java.jspage.php has in it the line: include ( ../header.php )andheader.php has in it the line: glob('*.*')Case 1: header.php has the line "../child-directory2/java.js"Glob returns files in home directory.Case 2: header.php has the line "http://www.home directory.com/child directory 2/java.js"Glob returns files in child directory 1Edit...I've change my code significantly so this is from memory so it may not be exactly as it was. But the theme is accurate. Changing how I refrenced the .js file from a relative link to a absolute link changed wich directory glob would search. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted September 28, 2006 Share Posted September 28, 2006 If you can create pieces of code that show the problem, it would be much better.Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.