PHP: Contact Form Redirect After Headers Sent

I recently had an issue where I wanted a PHP contact form to redirect to a thank you page after the headers had already been sent.  If you think outside of the PHP box, there is a very simple way to make this work using Javascript.  Just add this bit of code to the bottom of the page:

<?php

printf(“<script>location.href=’http://www.usdamortgagegroup.com/thank-you/368/'</script>”);
?>

Published by

Joel Gross

Joel Gross is the CEO of Coalition Technologies.