Riku Tuominen said:
Sorry, maybe I did not describe my problem correctly.
I do kow the server path.
My problem is following:
My file locations
/myfiles/mainfile.php
/inc/functions.php'
mainfile.php import myscript.php with by require_once('../inc/functions.php');
functions.php script wants to know the location of it self.
using print $_SERVER['PATH_TRANSLATED']; in functions.php script returns "/myfiles/mainfile.php" instead of /inc/functions.php
cause it is imported to mainfile.php
.
edit: *
Alexei Kubarev
I di try print $_SERVER['PHP_SELF'];
print $_SERVER['SCRIPT_FILENAME'];
print $_SERVER['PATH_TRANSLATED'];
print $_SERVER['SCRIPT_NAME'];
print $_SERVER['REQUEST_URI'];
*
gesf
seems there still is confusion what I am trying to do.
gesf i do not need the server path.
edit. meaning I do know it.
The problem is described above.
*edit
Propably cause of my bad english I missunderstod and gesf you understud me.
*
but gesf i think you solved the problem with:
define('MyPath', '/home/..../public_html/include/');
How long will that 'MyPath' be valid?
Thaks to you all for helping me.