1

I have a file check.php which is called in another php file call.php using file_get_contents('check.php'). I want to maintain a history of files calling check.php by getting the url of requesting files. I have tried $_SERVER['HTTP_REFERER'] but it is not helping. Is there any way I can find out the url of requesting file?

DannyPhantom
  • 1,042
  • 10
  • 21
  • possible duplicate of [PHP: How to get referrer URL?](http://stackoverflow.com/questions/16374704/php-how-to-get-referrer-url) – Szabolcs Páll Aug 26 '15 at 07:27

1 Answers1

0

You could use the debug_backtrace() inside check.php..

$debug = debug_backtrace();

..to display the calling file..

echo $debug[0]['file']);

..and Log this somehwere..

MaggsWeb
  • 3,018
  • 1
  • 13
  • 23