I have to redirect users to different pages.
So here is what I have now.
header('Location: http://www.example.com/$confirmpage')
But it doesn’t work. It redirects them to http://www.example.com/$confirmpage (value not retrieved.) and gives 404 error.
When I use
echo "<script>document.location='http://www.example.com/$confirmpage';</script>";
It works.
But I have to use header() function for some reasons.
If you want to refference variables in php strings, you have to use
"instead of'http://php.net/manual/en/language.types.string.php