Friday 10 August 2018

redirect - PHP header ('Location: ..') Not working on server

try to place the php code, at the beginning of the page, so that no output starts before,



    $host  = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'index.htm';
$final_url = 'http://'.$host.$uri.'/'.$extra;
header('Location:'.$final_url);



Replace code..

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...