I Have one registration and payment page. program flow is like registration > confirmation > payment. After validation and calculation in registration page need to go to confirm
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'confirm.php';
header("Location: http://$host$uri/$extra");
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include, or require, functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
Also try to change header('Location:confirm.php'); (Note L is capital since its work in your local server may be problem with strict php type try this once)
i had the same issues for years but today i discovered that u don't have to have any html or blank space before the header word .Try it out
use ob_end_flush()
at the end. This should work like charm.