header problem

bull

Verified User
Joined
Feb 3, 2005
Messages
20
Hi, I've got a little problem here about modifing a header
in php, I use a redirect and would like to change also the
referer but that doesn't seem to work out..

I use this piece of script;

header("Referer:http://www.sub.domname.com");
header("Location: http://www.anotherdom.com");

The Referer doesn't work right here, I've used exit; and
something like ob-start() and flush but the referer won't
change at all.....

I need a solution because some affiliate programs work with
a referer and because I use 100 subdomians I its just to much work to give them all a specific affiliate code

any help is welkom greetings Bull
 
Hello bull.

here is a quick copy/paste that works well for me.

Code:
<?php
  $host='http://yourhost.com/';
  $headers  = "GET index.php?url=apage HTTP/1.0\r\n";
  $headers .= "Host: $host\r\n";
  $headers .= "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204\r\n";
  $headers .= "Accept-Language: en-us, en;q=0.50\r\n";
  $headers .= "Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66\r\n";
  $headers .= "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1\r\n";
  $headers .= "Connection: close\r\n";
  $headers .= "Cache-Control: max-age=0\r\n\r\n";
?>
 
Hi Sky
At first thanks for your help..

I see you create a variable called $headers but whats the
following procedure?

when or how do you use the header() function?

like this?

header ($header);

please would you explain this to me?, thanks already Bull..
 
Back
Top