Dear All
This is a sort of spin-off from my previous post, but since the post has gone off on a tangent I felt it would be better to start a new topic related to the subject title.
I'm trying to work out how to express the root directory path of my server (the server is remote to my computer, I upload all my PHP scripts to my remote server and run the server) so I can upload files to a directory called 'tmp' in the root directory of my server space.
However, IIS seems a bit strange and I don't know how to express the file path, so I can upload pictures via the move_upload_file function. I have been told that expressing pathnames is different to how you would for an Apache server.
Does anyone use a Windows-based server, and if so how do you normally express your root directory pathname?
Many thanks
Mark
Root directory path of server under IIS
Moderator: General Moderators
From the previous post, the problem seems to be that $_SERVER['DOCUMENT_ROOT'] on IIS is returning the path to the file, not the doc root directory.
I apologize for that,
Seems that I have misunderstood the questions here. There was no link to the previous post, and I (stupidly) did not check "all posts by.." feature to find it.
But, you are right, I think I do remember this sort of problem when I once worked on IIS, unfortunately I do not have a solution for that.
Yours,
Fjook
Seems that I have misunderstood the questions here. There was no link to the previous post, and I (stupidly) did not check "all posts by.." feature to find it.
But, you are right, I think I do remember this sort of problem when I once worked on IIS, unfortunately I do not have a solution for that.
Yours,
Fjook
IIS provides different vars than Apache, this is how I do it... this defines a constant to my HOME file system
Code: Select all
if (isset($_SERVERї'DOCUMENT_ROOT'])) define('HOMEFS', $_SERVERї'DOCUMENT_ROOT']);
else define('HOMEFS', str_replace(str_replace(""e;, "//",$_SERVERї'PHP_SELF']), "", str_replace("\"e;, "/",$_SERVERї'PATH_TRANSLATED'])));