finding local path on server
finding local path on server
am 08.10.2007 18:33:39 von ll
I'm trying to see if there is a way to determine the 'local path' on a
server (as opposed to the url path) via application, etc?
For example:
$parent_url = "http://www.testsite.org/upload/";
$parent_dir = "c:\\public_html\\upload\\";
Thanks,
Louis
Re: finding local path on server
am 08.10.2007 19:14:36 von lws4art
ll wrote:
> I'm trying to see if there is a way to determine the 'local path' on a
> server (as opposed to the url path) via application, etc?
>
> For example:
>
> $parent_url = "http://www.testsite.org/upload/";
> $parent_dir = "c:\\public_html\\upload\\";
Well it looks like possibly PHP?
then
$me = $_SERVER['SCRIPT_FILENAME'];
will have the path with the script file name that you can remove.
or it might be Perl:
my $me = $ENV{'SCRIPT_NAME'};
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Re: finding local path on server
am 08.10.2007 22:39:11 von ll
On Oct 8, 12:14 pm, "Jonathan N. Little"
wrote:
> ll wrote:
> > I'm trying to see if there is a way to determine the 'local path' on a
> > server (as opposed to the url path) via application, etc?
>
> > For example:
>
> > $parent_url = "http://www.testsite.org/upload/";
> > $parent_dir = "c:\\public_html\\upload\\";
>
> Well it looks like possibly PHP?
>
> then
>
> $me = $_SERVER['SCRIPT_FILENAME'];
>
> will have the path with the script file name that you can remove.
>
> or it might be Perl:
>
> my $me = $ENV{'SCRIPT_NAME'};
>
> --
> Take care,
>
> Jonathan
> -------------------
> LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com
Thanks Jonathan,
The page prints the file directory - is there a way to get the
complete directory?
Thanks
Louis
Re: finding local path on server
am 08.10.2007 23:06:01 von ll
On Oct 8, 3:39 pm, ll wrote:
> On Oct 8, 12:14 pm, "Jonathan N. Little"
> wrote:
>
>
>
> > ll wrote:
> > > I'm trying to see if there is a way to determine the 'local path' on a
> > > server (as opposed to the url path) via application, etc?
>
> > > For example:
>
> > > $parent_url = "http://www.testsite.org/upload/";
> > > $parent_dir = "c:\\public_html\\upload\\";
>
> > Well it looks like possibly PHP?
>
> > then
>
> > $me = $_SERVER['SCRIPT_FILENAME'];
>
> > will have the path with the script file name that you can remove.
>
> > or it might be Perl:
>
> > my $me = $ENV{'SCRIPT_NAME'};
>
> > --
> > Take care,
>
> > Jonathan
> > -------------------
> > LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com
>
> Thanks Jonathan,
> The page prints the file directory - is there a way to get the
> complete directory?
>
> Thanks
> Louis
Thanks - I put this script that prints several keys. Is there
actually a way to discern what drive the directory is on (on the web
server)?
Louis
-------------
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print <
Print Environment
EndOfHTML
foreach $key (sort(keys %ENV)) {
print "$key = $ENV{$key}
\n";
}
print "";