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

Link to comment
Share on other sites

** 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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.