Forum Moderators: coopster
Is possible know with PHP which is the real web path?
In some servers FTP connect directly to the web path, others have subdirectories and the public_html are the real web path... Others use other name (www for example)...
Is possible retrieve from PHP which is the real web path?
Well, in reality me problem is more complex, I pass to a script the ip, username and password of a remote server and I want to automatically upload a file to the web root directory of the remote server via ftp (ftp_connect, ftp_login... etc) and I not find how to know with code which is the web root directory, not all servers have public_html, other the web root directory is www and others connect directly via ftp to the web root directory...
I am searching in the web for the answer and no find the solution... Well, but I think is logical that has to be possible to know the web root directory...
Thanks in advance...!
The web root path is stored in the $_SERVER['DOCUMENT_ROOT'] variable. This will tell you the root of the current web site.
There are many of these kinds of variables stored in the environment when a script is running. See PHP's predefined variables [us3.php.net] for a comprehensive list.
Hope this helps!
Thanks jusdrum...
[edited by: coopster at 11:46 pm (utc) on Mar. 30, 2005]
[edit reason] No urls please (TOS [webmasterworld.com]) [/edit]
This question is also valid for the winsock dll and activex - also not are info, or I not find, of how know wath is the web root dir -, is the same, how make a ftp program that connect directly always to the web root directory...
For example, you have various webs and want to perfom some operations via ftp automatically and need to upload archives to the web root, instead of insert for each ftp connection wath is the web root dir for upload - lost time - is possible to automatize...
I think in some place must be which is that web root dir, but I not find solution... Not find also in documentation of winsock...