I am not sure if this is possible but was wondering if we can detect the url from where header('Location: ')
initiated.
I have a couple of scripts with header('Location: /main.php')
and now when main.php is executed I want to find out from which script or URL did the redirect initiate from.
script.php
header('Location: /main.php');
main.php
//detect the source url.. ie /script.php or website.com/script.php
// do some action
header('location: /script.php');
Is this possible?