I have the following piece of code
if ($_REQUEST['referer_url'] == "" ) {
header("location: index.php");
exit;
}
header('location: http://' . $_REQUEST['referer_url']);
exit;
And I get the error Warning: Header may not contain more than a single header, new line detected
. This is because in the header it adds a new line. I tried doing an urlencode
like suggested here on stackoverflow, but it redirect me to a server not found error with an odd url containing an undefined index
within the url. What else can I try in order to maintain the $_REQUEST['referer_url']