Hi i just want to ask if how i can echo the include file script
**index.php**
<?php
include('inc.php');
?>
**inc.php**
<?php
echo $_SERVER['PHP_SELF'] ;
?>
+++++++++++++++++++++++++++++++++++++
my files is located in localhost/test/file/
the out put of the script above is /test/file/index.php
What i want is the output should be /test/file/inc.php
Please help.
I believe what you’re looking for something like this:
then you can just echo $pathToInc or whatever you name your variable from within your inc.php. This should output the path within that variable and not the patch of index.php.