I have a file in server.
It's location is:
/home/myonbiz/public_html/domainname/path1/path2/.../done.txt
how can I know the path of file starting with "http://domainname/path/done.txt" using php function.
when I try to print it using command
<?php
$path="path/path/done.txt";
$dir = $_SERVER['DOCUMENT_ROOT'].$path;
echo $dir;
?>
it gives
/home/myonbiz/public_html/domainname/path1/path2/.../done.txt
but I needed only http://domainname/path/done.txt
how can I know the path of file starting with "http://d
Moderator: General Moderators
-
stallingjohn
- Forum Newbie
- Posts: 6
- Joined: Mon Apr 23, 2007 2:16 am
-
Well, my experience is that each server handles variables like DOCUMENT_ROOT different, and there will always be a server that has a new variation of the paths/dirs/whatever.
Let's see what the others write down. Perhaps you should search the forum. This was answered already. If I remember correctly, feyd posted something already (with basedir() and so on).
djot
-
Well, my experience is that each server handles variables like DOCUMENT_ROOT different, and there will always be a server that has a new variation of the paths/dirs/whatever.
Let's see what the others write down. Perhaps you should search the forum. This was answered already. If I remember correctly, feyd posted something already (with basedir() and so on).
djot
-
-
stallingjohn
- Forum Newbie
- Posts: 6
- Joined: Mon Apr 23, 2007 2:16 am
Thanks Mr.nyfael
Hi nyfael I tried it and it worked thanks for your super valuable suggestions