I am doing coding in oops for uploading image in PHP. But After submit image, it\'s giving warning
\"Header may not contain more than a single header, new line detec
Trouble could be in your phpMyAdmin, table wp_options, option_value.
If there is a space before the URL it will generate the ERROR: warning: header may not contain more than a single header, new line detected in...
You shouldn't put more than two lines in URL address. Check you URL.
Good URL - "http://mail.google.com" - 1 line
Bad URL - "http://mail. - 2 lines
google.com/"
This warning occurs to indicate that you might have a new line [/n] in the string content of your variables. Example
header("Location: ../control.php?post='$title1'&sample='$val'");
here there are 2 variables
$title1 and & $val
so while running if This warning occurs warning
“Header may not contain more than a single header, new line detected”
The solution is To strip out the passable new line contents of the variable Like this
$val=str_replace(PHP_EOL, '', $val);
$title1=str_replace(PHP_EOL, '', $title1);
Then you can include the variables in the header
The ideal way of solving it is like this
$url="../control.php?post='$title1'&sample='$val'";
$url=str_replace(PHP_EOL, '', $url);
header("Location: $url");
** This will work 100%;**
Try encoding your URL and it should work : http://php.net/manual/en/function.urlencode.php
in "Illuminate\Auth\Middleware\Authenticate" The method "redirectTo" should return an url path, not the Redirect response.
...
protected function redirectTo()
{
if(\Auth::user()->hasRole('copy')){
return '/copy/dashboardCopy';
}
}
...
Seems like the variables you are using to create the Location attribute has a new line character in them. Pass them through urlencode()