Jump to content

Archived

This topic is now archived and is closed to further replies.

obaluba

Open PHP page in Parent window...

Recommended Posts

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 work

any help would be greatly appreciated  :)

thanks

Share this post


Link to post
Share on other sites
would be better if you use $_SERVER['HTTP_REFERER']; and thats headers part not PHP

Share this post


Link to post
Share on other sites
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's

Maby there is some javascript you can use to do this if you ask in JS forum?

Liam

Share this post


Link to post
Share on other sites
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!! :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
You can generate JS from PHP but they dont work together.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.