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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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!! :) Quote Link to comment 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. Quote Link to comment 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! Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.