PC Nerd Posted June 29, 2008 Share Posted June 29, 2008 Hi, if i am running a script from "..../www/update/index.php" and i include: "..../www/includes/login/login.php" or similar..... When I ask the login.php to display the script name, which URL will it display/use? will it display: ....../www/update/index.php or ..../www/includes/login/login.php? * context, im building a bread crumbs sort of menu. If it displayes the login.php directory, is there a way i can force PHP to return the file that called it??? Thanks Link to comment https://forums.phpfreaks.com/topic/112394-solved-included-files-execution-directories/ Share on other sites More sharing options...
hitman6003 Posted June 29, 2008 Share Posted June 29, 2008 When I ask the login.php to display the script name, which URL will it display/use? Why don't you try it and find out... echo __FILE__; Link to comment https://forums.phpfreaks.com/topic/112394-solved-included-files-execution-directories/#findComment-577020 Share on other sites More sharing options...
PC Nerd Posted June 29, 2008 Author Share Posted June 29, 2008 oh - yeah .... sry didnt register to simply code the 2 lines of code... :|!! um - can i tell php in any way to use the filename of the script that has gone: require("ME???");??? Thanks Link to comment https://forums.phpfreaks.com/topic/112394-solved-included-files-execution-directories/#findComment-577022 Share on other sites More sharing options...
hitman6003 Posted June 29, 2008 Share Posted June 29, 2008 um - can i tell php in any way to use the filename of the script that has gone: require("ME???");??? not sure what you're asking. Link to comment https://forums.phpfreaks.com/topic/112394-solved-included-files-execution-directories/#findComment-577024 Share on other sites More sharing options...
PC Nerd Posted June 29, 2008 Author Share Posted June 29, 2008 ** dont worry.... sry i looked into the manual, and tried the options of filenames: <?php echo $_SERVER['SCRIPT_NAME']; echo "<br>"; echo __FILE__; echo "<br>"; echo $_SERVER['SCRIPT_FILENAME']; ?> output: /tests/includes.php C:\xampp\htdocs\tests\dir\run.php C:/xampp/htdocs/tests/includes.php so i simply use 'SCRIPT_FILENAME' thanks ( I posted output for future referecne for people searchign forum Thanks:>:>:> Link to comment https://forums.phpfreaks.com/topic/112394-solved-included-files-execution-directories/#findComment-577025 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.