scandir problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Using their method, what is the proper way to insert a variable within the

e.g. /$variable

Is the ending / needed?
this does not work.
$dir=" /$variable"
$dir=" /".$variable

Re: scandir problem

On Sat, 3 May 2014 11:43:45 -0400, richard wrote:

Quoted text here. Click to load it

I did get it working by using the ".." before the path.
Apparently, the full url method does not work in this case.

Re: scandir problem

On Sat, 03 May 2014 12:08:18 -0400, richard wrote:

Quoted text here. Click to load it

The problem that you encountered is not the problem that you stated it  
was. Your error[1] was the failure to understand the difference between  
an http url and a filesystem path.

The webserver translates the http url to the filesystem path, where the  
"root" directory of the webserver "" might be at a file  
path that looks something like "/users/s/"

For example, on a fasthosts uk server, using apache, the root of the http  
files is available as:

Your problem is that you were trying to use a url as a filepath.

What you need to do is take the url:

replace the part: " " with "{$_SERVER

then append the path part of the url: "/dir/"

then append your $variable

To generate:

$dir = "/dir/"

[1] otherwise known as yet another richardian fuckup

Denis McMahon,

Site Timeline