Click to See Complete Forum and Search --> : PHP Redirection from an iframe


Operandi
02-24-2006, 05:29 AM
I am using an iframe to deliver a form to a number of customer web sites. Each site needs its own thank you page outside the iframe however I'm struggling to redirect the user to these pages outside the iframe.

I've tried writing a javascript window.parent.location command to the browser from the PHP script, but I think timing issues mean that the browser doesn't always obey this.

Using header ( "location : http://www.theirsite.com/thank_you.php" ); loads the page in the iframe rather than outside the iframe.

Any ideas how to solve this would be gratefully received.

Thanks
Chris

MarkR
02-24-2006, 07:02 AM
Are the frames coming from different domains? If so, then you will find that the browser forbids cross-domain scripting - therefore you won't be able to script the other frames.

You can still submit a form with a target of _top I think.

Mark

steelwidow
02-24-2006, 10:26 AM
try target_blank

Operandi
02-27-2006, 04:49 AM
Are the frames coming from different domains? If so, then you will find that the browser forbids cross-domain scripting - therefore you won't be able to script the other frames.

The iframe is hosted on my server and displayed on my customer's domains, so I want the header ( "location") command to then load the thank you page on their domain. It currently loads it in the iframe and not extenal to the iframe.

Unfortunatley neither target=_blank or target=_top seems to work with the header command, but thanks for the suggestions.