473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

iframes question

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?

Shelly

Dec 28 '05 #1
7 1406
Shelly wrote:
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.

Don't use frames. See:

http://webdevelopment.developersnetw...sp?Article=120

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.replace(document.location.href);
else
top.location.href = document.location.href;
}
</script>
Side question: How do I bring up a new page in php, rather than
replacing the existing page?

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

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

</body> Shelly

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.
js*******@attglobal.net
==================
Dec 28 '05 #2
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.

Dec 28 '05 #3
How do you do it? This is not an href. It is a button.

Dec 28 '05 #4
"Shelly" <sh**************@asap-consult.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
How do you do it? This is not an href. It is a button.


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">
</form>

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Dec 28 '05 #5
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?

Dec 28 '05 #6
On Tue, 27 Dec 2005 20:32:21 -0800, Shelly wrote:
Side question: How do I bring up a new page in php, rather than
replacing the existing page?


target="_blank"

--
http://www.mgogala.com

Dec 28 '05 #7
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"
frameborder="0"scrolling="no"
style="background-color:#FFCC99"></iframe></td>
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
well..emai:contactfastATgmailDOTc*m

have a nice time..

bye..

Dec 28 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: maxim vexler | last post by:
I'm reading a lot of talks lately about the term iFrame and with your permission would like to ask a few question about that : - what is iFrame, i mean what is it good for ? - does all the...
3
by: GQ | last post by:
We have a Web page that at load time will execute and build: a DHTML Menu/Data Driven, an Iframe with Detail Data, an Iframe to display Progress Information and another iframe with totals...
0
by: Dan Popa | last post by:
Check out the following 2 links: http://www.batisdev.com/admin/test_1images.asp http://www.batisdev.com/admin/test_2images.asp First page contain 4 IFRAMES and 1 IMG tags. Second page contain 4...
8
by: Steinar Bang | last post by:
Is there a way to catch HTTP 4xx and 5xx errors occuring in an IFRAME? I want to replace the blue and white tomcat error pages, with a small discrete text saying "The page currently not available"....
4
by: Howard Jess | last post by:
In a javascript-heavy page, an iframe is created to hold information from a secondary server CGI process, and the resulting data (in the iframe) is used to rewrite some content in the main page. To...
9
by: Stimp | last post by:
I have an IFRAME on a webpage with a large height to accommodate a big list output in the frame. If I go down the list and click a row, a new page opens in the IFRAME, but this is a problem if...
5
by: Frances | last post by:
I need to replace iframes acc. to what option user chooses in a sel obj.. but figured have to load a blank iframe when pg loads so I can replace it.. (iframe gets put in a pre-existing div..) this...
2
by: Guadala Harry | last post by:
1. Are IFrames supported only in uplevel versions of IE? If not IE exclusively, what browsers support IFrames? 2. Are IFrames going to be supported in the future - as far as anyone knows - or...
19
by: wmanzo | last post by:
I have a really professional conspiracy movie site and I use tons of layers and an external scroll bar assembly. I would like to put the various sections into MS Iframes and in order to clean up...
2
by: Vohaul | last post by:
Hi there, I'm new to this site, but have been doing webpages with flash, html, css for a few years. I'm a convert from graphic designer to web Anyway, I have a client site that i designed a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.