the magic constant __FILE__ will give you the absolut filesystem location of the file it is called. Eg:

/home/www/tests/foo.php ->
<?php
  echo __FILE__ ;
?>

will print: '/home/www/tests/foo.php';

to retrieve the path only you could do:
/home/www/tests/foo.php ->
<?php
  echo str_replace( basename ( __FILE__ ) , '' , __FILE__ );
?>

will print: '/home/www/tests/';

hope this helps :-)

Dennis Gearon wrote:

please CC me 'cause I am on digest

the scenario:
three files:
.htaccess
has line saying "php_prepend 'true_filesystem_location_php_prepend_file' "
prepend.php (aforementioned prepend file)
has line saying "include file_a.php"
file_a.php
has line saying"$my_true_file_system_location = I_NEED_A_FUNCTION_HERE;"


So, what do I replace I_NEED_A_FUNCTION_HERE with?

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to