Reputation: 1849
I have a php file that could be included in different places. I need to have some rule on what to show depending on the including file.
Using $_SERVER['REQUEST_URI']
is returning the path of the page itself not the parent file that's including it.
Upvotes: 1
Views: 1366
Reputation: 1802
Try:
<?php
echo $_SERVER['SCRIPT_FILENAME'];
The full list can be found on the PHP website.
Upvotes: 3