Jump to content

How to redirect after headers are sent


mostafatalebi

Recommended Posts

Hello everybody

 

I have made a download script that would send HTTP headers to the browser so to generate a download dialog box. But I need to redirect after the download window is shown. Like many sites on the internet. I cannot achieve this since it is a common problem. A redirection cannot happen as headers are already sent. What shall I do?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/274873-how-to-redirect-after-headers-are-sent/
Share on other sites

You can't header redirect and trigger a download at the same time.

 

You could redirect to the page which then redirects to the download (and thus won't take the user away from that page). Other options depend on the purpose of the pages and the download.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.