Temporary redirect prevents getting $_POST array

A brief background on the behavior of 3xx status codes

A 302 redirect is treated differently across browsers. Partially because of the variance of 302 in HTTP/1.0 and HTTP/1.1. HTTP 1.1 302 Found specifies that the request must not automatically be reprocessed at the returned location URI unless it can be confirmed by the user.

HTTP/1.0 were handled ambiguously prompting the creation of 303 and 307 for HTTP/1.1. 303 is to discard a POST where a 307 is to reprocess the request.

Data Flow

What is causing the redirect in this situation is unclear, but it is following a common behavior of resending the POST request as a GET request. I am assuming that all of the form processing is done elsewhere and sent to thankyou.php upon validation and a proper conversion. Based on this assumption there is likely a better place to tie in and implement the email functionality.

Leave a Comment