[PHP] Redirect with referer info
Hi list, I need to redirerect a page, and send the referer information along with the redirect. I have tried: header(Location: $url); and printhtmlheadmeta http-equiv='refresh' content='0; URL=$url' //head/html; Both of them redirect as expected, but the browser (Firefox and Opera) do not send referer information along with the request. As this is for link affiliates, I need that referer info sent with the request. How to do that? Thanks. Dotan Cohen Song Lirics http://song-lirics.com/sl/artists.php/b Song Lirics -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect with referer info
Dotan Cohen wrote: Hi list, I need to redirerect a page, and send the referer information along with the redirect. I have tried: header(Location: $url); and printhtmlheadmeta http-equiv='refresh' content='0; URL=$url' //head/html; Both of them redirect as expected, but the browser (Firefox and Opera) do not send referer information along with the request. As this is for link affiliates, I need that referer info sent with the request. How to do that? Thanks. Dotan Cohen Song Lirics http://song-lirics.com/sl/artists.php/b Song Lirics URL parameters. $url=www.somesite.org?id=asdfreferrer=2345; header(Location: $url); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect with referer info
To obtain a certain portion of the referring url you might look at parse_url(); See http://us3.php.net/manual/en/function.parse-url.php - or - If you want to bounce the user right back to the previous page including get variables you could just use this snippet. ?php $referrer = $_SERVER['HTTP_REFERER']; header(Location: . $referrer); exit; ? On Jul 30, 2005, at 9:36 AM, Dotan Cohen wrote: Hi list, I need to redirerect a page, and send the referer information along with the redirect. I have tried: header(Location: $url); and printhtmlheadmeta http-equiv='refresh' content='0; URL=$url' //head/html; Both of them redirect as expected, but the browser (Firefox and Opera) do not send referer information along with the request. As this is for link affiliates, I need that referer info sent with the request. How to do that? Thanks. Dotan Cohen Song Lirics http://song-lirics.com/sl/artists.php/b Song Lirics -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect with referer info
On 7/30/05, Joe Wollard [EMAIL PROTECTED] wrote: To obtain a certain portion of the referring url you might look at parse_url(); See http://us3.php.net/manual/en/function.parse-url.php - or - If you want to bounce the user right back to the previous page including get variables you could just use this snippet. ?php$referrer = $_SERVER['HTTP_REFERER']; header(Location: . $referrer); exit; ? I must have not phased the question well. I have a page on http://lyricslist.com that links to http://song-lirics.com and it is very important that the request to http://song-lirics.com has the referer part of the request intact. There is no id=xxx or whatever, the server at http://song-lirics.com looks at the $HTTP_REFERER to grant points. That works great when on http://lyricslist.com I do a simple a href='~'lyrics/a to http://song-lirics.com, but I don't want to do that. Instead, I link to another page on http://lyricslist.com so that I can record how many people clicked on the link, and then I want to redirect to http://song-lirics.com It's just that with the two redirect methods that I know of (header and meta), the request to http://song-lirics.com gets there with no referer information, as if the user typed in the address. If you want to see it, click: http://song-lirics.com/sl/goto.php/4 You will be redirected to http://dotancohen.com Look at the source code, in the first few lines you will see: !-- Refferer: User_Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc4 Firefox/1.0.6 Time: July 30, 2005, 12:36 pm -- No referer! Try clicking around http://dotancohen.com and look at the source code: they all have referers! Dotan Cohen http://ie-only.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php