| 2:36 pm on Aug 29, 2006 (gmt 0)|
Using header('Location: http://www.example.com'), C will see A as the referrer.
| 10:09 pm on Aug 29, 2006 (gmt 0)|
This is the index.php on site B which does the redirection to Site C.
As of now... NO referrer is getting passed. That is the problem.
| 11:53 pm on Aug 29, 2006 (gmt 0)|
Thats because nothing is reffering it! Changing the header is not the same as a link as all you arn't being reffered to the page you are merely changing the header (like just entering the URL into your URL bar in a browser). You could try some sort of META refresh but im not sure if thats any different.
There must be a way round it, perhaps you could pass the B URL as a GET Var?
| 12:02 am on Aug 30, 2006 (gmt 0)|
Well.. I have no idea how to do this but I need to pass some referrer to site C (it can be site B or site A as referrer, although I prefer B).
| 12:30 am on Aug 30, 2006 (gmt 0)|
OK this works, I have just tested it:
- page-a.php contains an HTML text link to page-b.php
- page-b.php simply contains the code
- page-c.php echos the referrer.
When clicking the link on page-a.php I am taken to page-c.php and the referrer is shown as page-a.php
If you get a blank referrer then maybe:
a) Your code for displying the referrer is incorrect
b) Your browser or security software is not supplying the referrer
c) There's some different between my server and yours so that they exhibit different behaviour
You could pass a referrer variable in the URL, as previously suggested:
| 1:30 am on Aug 30, 2006 (gmt 0)|
barns... it seems to work when all 3 files are on the same server (site). but when site B redirects to external site C, its a different story and the referral gets lost. try it.
| 1:36 am on Aug 30, 2006 (gmt 0)|
Localhost -> remote server passes the referrer for me, too.
I didn't know that the referrer would be passed until recently, when I saw it show up in an affiliate report where a header(Location: ) was used to redirect visitors.
It definitely works. Check your browser/server settings. :)
[edited by: barns101 at 1:38 am (utc) on Aug. 30, 2006]
| 1:37 am on Aug 30, 2006 (gmt 0)|
try this for something quite generic:
[codes]header("Location: page-c.php?referrer=$_SERVER['PHP_SELF"); [/codes]
| 1:09 pm on Aug 30, 2006 (gmt 0)|
dimeric, that code gives me an error
| 3:25 pm on Aug 30, 2006 (gmt 0)|
I believe that it should read
| 11:25 pm on Aug 30, 2006 (gmt 0)|
woops sorry my code is wrong its a ] not a ) at the end
| 2:59 am on Aug 31, 2006 (gmt 0)|
Guys, guys, you're doing it the hard way. Just pass another header:
and it'll be transparent!