Friday, December 30, 2011

redirect iframe to its parent

Hi Guys, been googling for a night to find out how to redirect or basically replacing "header location" so the page will load a new page not stays at the same page.
And finally the solution is using a very simple javascript code:

 <script> parent.location = "blah.php" </script>

what you should do is when a submitted form in an iframe, you will need to "echo" your thank you page with that piece of code.
I hope this will help some people who still use custom PHP form in their CMS website.

No comments: