|
-
Aug 19th, 2002, 05:32 AM
#1
Thread Starter
Addicted Member
Server.MapPath - PHP equivalent?
Is there a function (or has someone else written one) that does the equivalent of ASP's Server.MapPath?
I know there are a few that will sort of do it, but quite often they will return stuff like ../../../../whatever - which is pretty much useless for my purposes! I'm after the full path on the local file system.
Say there is a page on a website named "index.html"...I'd like a function that would convert that to "/usr/local/home/httpd/htdocs/index.html" or "c:\apache\htdocs\index.html".
Any ideas?
-
Aug 19th, 2002, 06:42 AM
#2
Conquistador
PHP Code:
echo realpath(substr($PHP_SELF, 1));
//or
echo realpath("index.php");
Hope it helps
-
Aug 19th, 2002, 10:09 AM
#3
Lively Member
or
echo $_ENV["SCRIPT_FILENAME"];
or
echo $_SERVER["SCRIPT_FILENAME"];
does the samething.
and Da_Silvy, $PHP_SELF has pretty much gone to the wayside if used by itself.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 19th, 2002, 02:02 PM
#4
Thread Starter
Addicted Member
-
Aug 19th, 2002, 03:11 PM
#5
Lively Member
yes I did and they haven't added it back as of yet.
ahh I see what you are doing.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 19th, 2002, 03:25 PM
#6
Thread Starter
Addicted Member
Who's the cheeky chappy on your avatar?
Something else I seem to have lost.
-
Aug 19th, 2002, 04:47 PM
#7
Lively Member
that is sully from Monsters Inc.
don't know if you have found the thread in the feedback forum, but you can ask for your posts and stuff back. just give a jingle in that thread and show where you have posted that says guest and not yet registered.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 19th, 2002, 04:48 PM
#8
Conquistador
no worries
-
Aug 19th, 2002, 05:49 PM
#9
Thread Starter
Addicted Member
Originally posted by scoutt
that is sully from Monsters Inc.
don't know if you have found the thread in the feedback forum, but you can ask for your posts and stuff back. just give a jingle in that thread and show where you have posted that says guest and not yet registered.
D'ya know, I think I've asked you that before, Scoutt. Sudden deja vu when I just read your reply. 
Mmmm...a post in that thread, I have made.
-
Aug 19th, 2002, 05:56 PM
#10
Lively Member
probably, it does sound familiar.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|