obaluba Posted August 14, 2006 Share Posted August 14, 2006 Hi,I think this is fairly simple although I have been tearing my hair out all day! Basically.. I have a html page which has an iframe on it which loads a php page which contains a form. Once the form is filled out I have this code to return it to another html page. currently the html page is loading in the iframe, I need to find a way to make it load in the parent of the iframe if you like...The code I have is below for this section... $ThankYou = $_GET['ThankYou']; if ($ThankYou != "") { $message = "Thankyou, you will now be forwarded to the technical section."; header("HTTP/1.1 301 Moved Permanently"); header ("Location: http://www.google.com"); }I tried adding this having found it on another site: header("target_parent"); but didnt seem to workany help would be greatly appreciated :)thanks Link to comment https://forums.phpfreaks.com/topic/17528-open-php-page-in-parent-window/ Share on other sites More sharing options...
Chetan Posted August 14, 2006 Share Posted August 14, 2006 would be better if you use $_SERVER['HTTP_REFERER']; and thats headers part not PHP Link to comment https://forums.phpfreaks.com/topic/17528-open-php-page-in-parent-window/#findComment-74615 Share on other sites More sharing options...
shocker-z Posted August 14, 2006 Share Posted August 14, 2006 I think that what you would need to do is nothing to do with PHP but is to do with your POST you need to POST to the parent frame and then let that process and change the header location as using headers changes that single file e.g. inside the iframe instead of what you want which is the actual page the user see'sMaby there is some javascript you can use to do this if you ask in JS forum?Liam Link to comment https://forums.phpfreaks.com/topic/17528-open-php-page-in-parent-window/#findComment-74620 Share on other sites More sharing options...
obaluba Posted August 14, 2006 Author Share Posted August 14, 2006 Is there no way it can be done in the PHP posted, nothing that can be put in the header section? I'm a total novice at PHP, so my knowledge is primative at best!! :) Link to comment https://forums.phpfreaks.com/topic/17528-open-php-page-in-parent-window/#findComment-74631 Share on other sites More sharing options...
Chetan Posted August 14, 2006 Share Posted August 14, 2006 PHP is though dynamic it can only give the browser a HTML code it can though be like a software but it cant control the browser. Link to comment https://forums.phpfreaks.com/topic/17528-open-php-page-in-parent-window/#findComment-74636 Share on other sites More sharing options...
obaluba Posted August 14, 2006 Author Share Posted August 14, 2006 could i use some javascript on my php page (the one i posted a bit of above) to get it to open in the parent window do you think? does PHP and JS work together in that way?thanks, sorry for the novice questions! Link to comment https://forums.phpfreaks.com/topic/17528-open-php-page-in-parent-window/#findComment-74640 Share on other sites More sharing options...
Chetan Posted August 14, 2006 Share Posted August 14, 2006 You can generate JS from PHP but they dont work together. Link to comment https://forums.phpfreaks.com/topic/17528-open-php-page-in-parent-window/#findComment-74644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.