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.
header("Location: http://www.example.com/$confirmpage")
If you want to refference variables in php strings, you have to use "
instead of '
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.