php - header() function removes HTTP_REFERER -


this question has answer here:

there might many releated question on , many articles it, unable understand reason it.

what trying achieve have affiliate sort of thing. in if user clicks on of our ads in google or anywhere else. taken page redirect him approprite page. redirecting use following code.

header("http/1.1 301 moved permanently");   header("location: http://www.example.com/page2.php"); 

suppose code written on page1.php , user redirected page2.php. on page1 referer user arrived (google.com instance). on page2.php don't referer page1. seems me strange behavior. can put light on reason of behavior.

ps: have workaround adding cookie before redirect , retriving value on page2.

thanks

if i'm not mistaken, referrer sent browser (if allowed, not browsers it, , can changed client), meaning page1 never set referrer page 2 it's server doing redirection, not client. knowledge, there no way "fake" it, although technique proposed bansi looks tempting, i've seen multiple posts on web indicating doesn't work.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -