Page 1 of 1

[SOLVED] need help with URLs

Posted: Mon Aug 02, 2004 10:18 pm
by LegoBoy
1st, is there a function to return the current file URL you are viewing?

2nd, is there any way I can make an include with (I hope this the proper term) absolute path? EG: include("/someFile.php");

Posted: Mon Aug 02, 2004 11:16 pm
by kettle_drum
1) Yes.

Code: Select all

$_SERVER['PATH_TRANSLATED'];
2) Yes you do it as your doing. Just play around with trying to include files and look at your results.

Posted: Tue Aug 03, 2004 10:30 am
by feyd
__FILE__ also works nicely for the absolute file you are in.. (not necessarily the script you are executing)

Posted: Tue Aug 03, 2004 2:29 pm
by LegoBoy
Ok. Thanks for the help. Now that I know about the $_SERVER array I'm using [PHP_SELF], [REQUEST_URI], and [HTTP_HOST]