Help - Redirect and include a referer.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Dr.Goodvibes
Forum Newbie
Posts: 19
Joined: Wed May 24, 2006 10:14 am
Location: New Zealand

Help - Redirect and include a referer.

Post by Dr.Goodvibes »

I am try to redirect to a new site and include a referer which I have modified..

I do not want to include the referer as part of the url. I want the referer to be part of the header so that the site I have redirected to can see the referer within the $_SERVER['HTTP_REFERER'] call.

I have looked at the follow:

Code: Select all

header (“referer: http://www.mysite.com”);
header(“location: http://www.newsite.com”);
This however does not forward the referer but uses the referer generated by the redirect and comes out as the url I was at when I redirected.

I have looked at cURL and it does send the referer however I’m not redirected to the new site. I am still in a shell in my own site.

Looking at fsockopen() I believe the outcome will be the same as cURL.

Is there any way of redirecting to a new site and have the ability to include a referer in the header which I have been able to modify before the redirect?

Thank you in advance for any ideas or help.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The referrer isn't dictated by the server.
Post Reply