Hello!
Sorry if it's a dump question but i really need to know:
How in my PHP file can i detect the path to this file for example if i put my file in directory like this: www.myserver.com/test/file.php i need to determine the directory that it's in : /test/ ?
PHP_SELF returns only file name "file.php"
Thank you
Hm, not sure that this will work, I haven't tested it:
$thisFolder = basename( dirname($_SERVER['PHP_SELF']) );
Look at the regexps side of things...
preg_match("!^.(.*?)(/[^/]+){2}$!", $_SERVER['PHP_SELF'], $parent); echo $parent[1];
See what it gives you..
The $parent is an array so choose 0 for the parent, 1 for grandparent dir etc...