iframes question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a submit button and in the php code I have

header("Location: thetargetpage.php");

I do the DB work and php and my daughter does the pretty work.  She put
my page inside an iframe.  So, when the submit button is clicked, it
brings up thetargetpage.php inside the iframe.

What we want is to have the destination page have just the
thetargetpage.php without the rest of the iframe.  How can we make that
happen?  For straight html href she uses _top as the target.  Here,
however, there has to be a lot of processing code before the
redirection with the header call.

Side question:  How do I bring up a new page in php, rather than
replacing the existing page?


Re: iframes question

Shelly wrote:
Quoted text here. Click to load it

Don't use frames.  See:


You can do virtually everything in CSS that you can do in frames.

Otherwise, you can't do it with PHP.  PHP runs server side; you need  
something which runs client-side, like javascript.  Something like this  
should work (untested):

<script type="text/javascript">
if (self != top){
    if (document.images)
       top.location.href = document.location.href;

Quoted text here. Click to load it

Pretty much the same problem, and a similar solution - javascript.  
Maybe something like outputting the following in the code...

<script type="text/javascript">
window.open ("newwindow.php");

Quoted text here. Click to load it

Of course, both of these methods fail if the user has javascript turned  
off.  It's one of the reasons I don't do either.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: iframes question

<27 Dec 2005 20:32:21 -0800>

Quoted text here. Click to load it

Why ? .

Re: iframes question

The server doesn't really have much discretion over where the contents
will go. That's determined on the client-side.

I don't quite understand your reason for not wanting to post the form
with _top as the target. Having a lot of processing code doesn't
preclude this as an option.

Re: iframes question

How do you do it?  This is not an href.  It is a button.

Re: iframes question

Quoted text here. Click to load it

A form has a target just as well. For example this opens a new window and  
submits the form there

<form method="post" action="example.php" target="_blank">
    <input type="submit" value="click me">

"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirvi
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)  

Re: iframes question

OK, getting there.  Now I want to go to a new page without iframe only
on success.  On failure I want to stay there.  Do I bracket the
target="_blank" in a php if/else?

Re: iframes question

DeaR Shelly,

For open page on new window :  <a href="example.php"
target="_blank">Click Here</a>

Using Iframe:
<iframe name="services" src="example.php" width="497" height="750"

i am working on that pages for a site and would be ready to use a day
after tommarow and if you want to see in action can mail me ,  i will
send you sample built page in zip , you can see, also i frame ..work

have a nice time..


Re: iframes question

On Tue, 27 Dec 2005 20:32:21 -0800, Shelly wrote:

Quoted text here. Click to load it



Site Timeline