iframes question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shelly

    iframes question

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

    header("Locatio n: thetargetpage.p hp");

    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.p hp inside the iframe.

    What we want is to have the destination page have just the
    thetargetpage.p hp 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

  • Jerry Stuckle

    #2
    Re: iframes question

    Shelly wrote:[color=blue]
    > I have a submit button and in the php code I have
    >
    > header("Locatio n: thetargetpage.p hp");
    >
    > 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.p hp inside the iframe.
    >
    > What we want is to have the destination page have just the
    > thetargetpage.p hp 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.
    >[/color]

    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.image s)
    top.location.re place(document. location.href);
    else
    top.location.hr ef = document.locati on.href;
    }
    </script>
    [color=blue]
    > Side question: How do I bring up a new page in php, rather than
    > replacing the existing page?
    >[/color]

    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>[color=blue]
    > Shelly
    >[/color]


    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@attgl obal.net
    =============== ===

    Comment

    • Chung Leong

      #3
      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.

      Comment

      • Shelly

        #4
        Re: iframes question

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

        Comment

        • Kimmo Laine

          #5
          Re: iframes question

          "Shelly" <sheldonlg.goog le@asap-consult.com> wrote in message
          news:1135771959 .937113.14990@g 47g2000cwa.goog legroups.com...[color=blue]
          > How do you do it? This is not an href. It is a button.
          >[/color]

          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ö
          spam@outolempi. net | Gedoon-S @ IRCnet | rot13(xvzzb@bhg byrzcv.arg)


          Comment

          • Shelly

            #6
            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?

            Comment

            • Mladen Gogala

              #7
              Re: iframes question

              On Tue, 27 Dec 2005 20:32:21 -0800, Shelly wrote:
              [color=blue]
              > Side question: How do I bring up a new page in php, rather than
              > replacing the existing page?[/color]

              target="_blank"

              --


              Comment

              • Lime

                #8
                Re: iframes question

                DeaR Shelly,

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

                Using Iframe:
                <iframe name="services" src="example.ph p" width="497" height="750"
                frameborder="0" scrolling="no"
                style="backgrou nd-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:cont actfastATgmailD OTc*m

                have a nice time..

                bye..

                Comment

                Working...