24
Jul/08
1

PHP header redirect

Something to remember when using header location to redirect a page from a server-side script.  The output is redirected to the new page, but the logic on the original file will continue to execute.  Therefore, if there are database calls the changes to the data will still be made even though a header redirect was issued.

To solve the problem, make sure to issue an exit() command after a header location command.

Filed under: Coding
Comments (1) Trackbacks (0)
  1. Simon, Denmark
    8:43 am on January 13th, 2009

    I wasn’t aware of that, thanks :)

Leave a comment

No trackbacks yet.