Jump to content

[SOLVED] included files execution directories


PC Nerd

Recommended Posts

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

** 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:>:>:>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.