Hello. I'm trying to make a small script that's changing the permission for specific file using a ftp connection. My problem is the absolute path. I have a ftp account wich land on the script directory (/script/). If i'm using getcwd, it will return the whole path (/home/user/public_html/script) but i need only the difference between the full path and the current path (getcwd path: /home/user/public_html/script/ ftp landing path: /script). So, how can i use getcwd to get the current directory for a ftp account? For example, if the user is landing in public_html, the path to the script will be /script/, or if he is landing inside /user, the path will be /public_html/script. Thanks
A:
The getcwd
call will only work for your local system. You need to program the logic to do the difference.
xyld
2010-05-04 16:40:17
Any idea from where to start?
John Doe
2010-05-04 17:40:01
A:
In your script, you should do a:
var_dump($_ENV);
And check if there is a variable which will help you in conjunction with getcwd(). Then you can do some string work on both results to get the path you need.
analogue
2010-06-16 00:07:31