I have 3 php file, I want to get referer of 1st in 3rd file with php.
I need to check the referrer of hits coming in php only.
I can't use document.referrer
in file3
as it can be easily cheated, my best bet is to rely somewhat on php referrer.
I am doing this way
file1.php content
<a href="file2.php">file2.php</a>
file2.php content
<script type="text/javascript" src="file3.php"></script>
file3.php content
alert("<?php echo $_SERVER['HTTP_REFERER'];?>");
I get alert as http://localhost/site/file2.php
but I want alert as http://localhost/site/file1.php
Please see and suggest any possible way to do this in php only.
Thanks