|
Posted by Jerry Stuckle on 12/28/05 06:59
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.developersnetwork.com/Articles.asp?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.
jstucklex@attglobal.net
==================
[Back to original message]
|