Adds a die(); function after every header call

-Earlier the header function was not being stopped or exiting from execution, so the script will be executed till the end, and can cause some unexpected behavior. Therefore, now using a die() after every header() of “Location” to close the connection