Jump to content

Archived

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

StarryGuy1980

Putting a die() after header(Location...)

Recommended Posts

I have seen the header("Location: http://example.com") takes some time to reach the browser but in the meantime the php script (if there is code after the header statement) continues to execute. So I recently started putting a die() immediately following the header() statement. I want to know if this a good practice? Do any of you experienced guys already do this?

 

 

Share this post


Link to post
Share on other sites

I want to know if this a good practice? Do any of you experienced guys already do this?

Yes, see this post for some details on why.

Share this post


Link to post
Share on other sites

×
×
  • 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.