[olug] PHP / getcwd() problem

Eric Pierce eric_olug at yahoo.com
Thu Nov 27 18:32:19 UTC 2003


Alright, I got it.  A little messier, but it works for getting the local path.

// Grab local path - strip filename
$temp_path = $_SERVER["SCRIPT_FILENAME"];
$spot = strrpos($_SERVER["SCRIPT_FILENAME"], "/");
$local_path = substr($temp_path, 0, $spot);


--- Eric Pierce <eric_olug at yahoo.com> wrote:
> Hi ho,
> 
> I'm writing a PHP script so I can upload files to my webspace.
> 
> I'm trying to grab the full local path of the current directory.
> 
> $local_path = getcwd();
> This (above) correctly gives me the full path on my local machine (Linux/PHP
> 4.2.2).  However, it produces nothing when I upload it to my web server (Net
> BSD/PHP 4.3.3).
> 
> Is there something or someway to get around this?  Or is my web server's
> php.ini set somehow to prevent me from doing this? (I don't control it the
> web
> server.)
> 
> Thanks,
> Eric Pierce
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


More information about the OLUG mailing list