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 Quote Link to comment 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__; Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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:>:>:> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.