can I call two consecutive headers in my php code ?
header("Location: http://" . $_SERVER["HTTP_HOST"] . "/$file"); //download file (http get)
header("Location: http://" . $_SERVER["HTTP_HOST"] . "/$page"); //redirect to page
The first header function redirect to a url to download a file, while the second header forwards the customer to the next page.
Currently, if I list both headers in sequence, the first header is ignored.
thanks
You can emit two headers but only one is going to be interpreted by the browser, so no, it’s not really possible.
I would consider serving the file download in a link with
target='_blank'to keep the original window intact.