I am trying to make a redirect to page based on its referrer. the layout is like
<?php
$URL_REF = $_SERVER['HTTP_REFERER'];
if($URL_REF == "url of my site") {
header("Location: url of another site");
exit();
}
else {
header("Location: my home page");
exit();
}
?>
I am getting the error : Cannot modify header information - headers already sent by
.
I have to modify my php.ini to output_buffering = On but I can't do this as I have a shared hosting account in hostgator. can anyone suggest me what options now I have? can I do it by changing my code? If yes, than what changes?