Refresh problem

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

    Refresh problem

    Hi. I have a Framed page, and in the "main" frame a userchoise is made. In
    my "top" frame I have a table containing some status info, the current
    logged on user (the username is saved in a SESSION variable) and some
    stuff like that. If I in the "main" frame change user (its a drop down
    list with choices from a MySQL DB) I would like to reflect that in the
    status row in the "top" frame. If I do a "header( Location blablabla )",
    that page is shown in the "main" frame, which of course is not desirable...

    If I hit the "Refresh" button in Internet Explorer, everything updates
    just fine, all the frames get updated and refreshed, including the "top"
    frame with the new username showing. How do I do this refresh from withing
    my php script that chooses a new user ? I have looked in the php-manual
    but havent been able to find anything about this.

    Any help would be very appreciated. I use PHP 4.3 on a RH 9.0 with Apache
    2.0.47
    Thanx.

    /ZoombyWoof
  • Richard Grove

    #2
    Re: Refresh problem

    "ZoombyWoof " <zoombywoofremo ve@thishotmail. com> wrote in message
    news:pan.2003.1 1.25.00.32.13.8 55717@thishotma il.com...[color=blue]
    > Hi. I have a Framed page, and in the "main" frame a userchoise is made. In
    > my "top" frame I have a table containing some status info, the current
    > logged on user (the username is saved in a SESSION variable) and some
    > stuff like that. If I in the "main" frame change user (its a drop down
    > list with choices from a MySQL DB) I would like to reflect that in the
    > status row in the "top" frame. If I do a "header( Location blablabla )",
    > that page is shown in the "main" frame, which of course is not[/color]
    desirable...[color=blue]
    >
    > If I hit the "Refresh" button in Internet Explorer, everything updates
    > just fine, all the frames get updated and refreshed, including the "top"
    > frame with the new username showing. How do I do this refresh from withing
    > my php script that chooses a new user ? I have looked in the php-manual
    > but havent been able to find anything about this.
    >
    > Any help would be very appreciated. I use PHP 4.3 on a RH 9.0 with Apache
    > 2.0.47
    > Thanx.
    >
    > /ZoombyWoof[/color]


    Ditch the framesets, they complicate matters.

    Regards
    Richard Grove

    http://shopbuilder.org - ecommerce systems
    Become a Shop Builder re-seller:
    Affiliate marketing is a simple way to earn money online, using our affiliate platform. Join a global community of publishers and advertisers.

    Affiliate marketing is a simple way to earn money online, using our affiliate platform. Join a global community of publishers and advertisers.






    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003


    Comment

    • ZoombyWoof

      #3
      Re: Refresh problem

      On Tue, 25 Nov 2003 09:11:36 +0000, Richard Grove wrote:
      [color=blue]
      > "ZoombyWoof " <zoombywoofremo ve@thishotmail. com> wrote in message
      > news:pan.2003.1 1.25.00.32.13.8 55717@thishotma il.com...[color=green]
      >> Hi. I have a Framed page, and in the "main" frame a userchoise is made. In
      >> my "top" frame I have a table containing some status info, the current
      >> logged on user (the username is saved in a SESSION variable) and some
      >> stuff like that. If I in the "main" frame change user (its a drop down
      >> list with choices from a MySQL DB) I would like to reflect that in the
      >> status row in the "top" frame. If I do a "header( Location blablabla )",
      >> that page is shown in the "main" frame, which of course is not[/color]
      > desirable...[color=green]
      >>
      >> If I hit the "Refresh" button in Internet Explorer, everything updates
      >> just fine, all the frames get updated and refreshed, including the "top"
      >> frame with the new username showing. How do I do this refresh from withing
      >> my php script that chooses a new user ? I have looked in the php-manual
      >> but havent been able to find anything about this.
      >>
      >> Any help would be very appreciated. I use PHP 4.3 on a RH 9.0 with Apache
      >> 2.0.47
      >> Thanx.
      >>
      >> /ZoombyWoof[/color]
      >
      >
      > Ditch the framesets, they complicate matters.
      >
      > Regards
      > Richard Grove[/color]

      Well, I have discovered that yes, but what if I still want my frames ? :-)
      It's quite nice to have a left frame so navigation gets easy, then I dont
      have to have links to everything on every page...and I want to be able to
      at all times see under what username I'm using the application without
      having to spell it out on every page...

      /ZW

      Comment

      • Kevin Thorpe

        #4
        Re: Refresh problem

        ZoombyWoof wrote:
        [color=blue]
        > Hi. I have a Framed page, and in the "main" frame a userchoise is made. In
        > my "top" frame I have a table containing some status info, the current
        > logged on user (the username is saved in a SESSION variable) and some
        > stuff like that. If I in the "main" frame change user (its a drop down
        > list with choices from a MySQL DB) I would like to reflect that in the
        > status row in the "top" frame. If I do a "header( Location blablabla )",
        > that page is shown in the "main" frame, which of course is not desirable...
        >
        > If I hit the "Refresh" button in Internet Explorer, everything updates
        > just fine, all the frames get updated and refreshed, including the "top"
        > frame with the new username showing. How do I do this refresh from withing
        > my php script that chooses a new user ? I have looked in the php-manual
        > but havent been able to find anything about this.
        >
        > Any help would be very appreciated. I use PHP 4.3 on a RH 9.0 with Apache
        > 2.0.47
        > Thanx.[/color]

        You'll have to resort to javascript (or vbscript <ugh!>) to do this.

        In the main frame you can insert the following if 'top' needs refreshing.

        <script language="javas cript">
        window.parent.t op.location.rel oad();
        </script>

        Using frames or not is sort-of a holy war. They are badly supported for
        some browsers, especially screen readers for blind users etc. I try and
        avoid using them for anything other than cosmetic reasons for the public
        parts of my websites (convenient sidebar menu etc) in case they aren't
        supported but rely on them heavily for web applications. Sometimes the
        only way to make a usable app is to use framesets (Windows Explorer,
        Outlook, Eudora etc).


        Comment

        • ZoombyWoof

          #5
          Re: Refresh problem

          On Tue, 25 Nov 2003 10:27:50 +0000, Kevin Thorpe wrote:
          [color=blue]
          > ZoombyWoof wrote:
          >[color=green]
          >> Hi. I have a Framed page, and in the "main" frame a userchoise is made. In
          >> my "top" frame I have a table containing some status info, the current
          >> logged on user (the username is saved in a SESSION variable) and some
          >> stuff like that. If I in the "main" frame change user (its a drop down
          >> list with choices from a MySQL DB) I would like to reflect that in the
          >> status row in the "top" frame. If I do a "header( Location blablabla )",
          >> that page is shown in the "main" frame, which of course is not desirable...
          >>
          >> If I hit the "Refresh" button in Internet Explorer, everything updates
          >> just fine, all the frames get updated and refreshed, including the "top"
          >> frame with the new username showing. How do I do this refresh from withing
          >> my php script that chooses a new user ? I have looked in the php-manual
          >> but havent been able to find anything about this.
          >>
          >> Any help would be very appreciated. I use PHP 4.3 on a RH 9.0 with Apache
          >> 2.0.47
          >> Thanx.[/color]
          >
          > You'll have to resort to javascript (or vbscript <ugh!>) to do this.
          >
          > In the main frame you can insert the following if 'top' needs refreshing.
          >
          > <script language="javas cript">
          > window.parent.t op.location.rel oad();
          > </script>
          >
          > Using frames or not is sort-of a holy war. They are badly supported for
          > some browsers, especially screen readers for blind users etc. I try and
          > avoid using them for anything other than cosmetic reasons for the public
          > parts of my websites (convenient sidebar menu etc) in case they aren't
          > supported but rely on them heavily for web applications. Sometimes the
          > only way to make a usable app is to use framesets (Windows Explorer,
          > Outlook, Eudora etc).[/color]

          Thanx a lot. I will try the javascript method as soon as I can, No
          vbscript :-)

          /ZW

          Comment

          • ZoombyWoof

            #6
            Got me a javaloop :-)

            On Tue, 25 Nov 2003 10:27:50 +0000, Kevin Thorpe wrote:
            *snip*
            [color=blue]
            >
            > You'll have to resort to javascript (or vbscript <ugh!>) to do this.
            >
            > In the main frame you can insert the following if 'top' needs refreshing.
            >
            > <script language="javas cript">
            > window.parent.t op.location.rel oad();
            > </script>
            >[/color]

            I tried this and then I get into a loop. This does exactly what pushing
            the refresh button in IE does (I checked the apache access_log), it also
            reloads the main frame where I inserted the java reload command, so it
            reloads, and reloads and reloads...:-)

            THis is what refresh button in IE and the java script generates :
            "GET /zwMD-UTV/ HTTP/1.1" 304 -
            "GET /zwMD-UTV/leftFrame.html HTTP/1.1" 304 -
            "GET /zwMD-UTV/topFrame.php HTTP/1.1" 200 554
            "GET /zwMD-UTV/mainFrame.php HTTP/1.1" 200 442


            I know absolutely nothing about javascript, is there some way to point out
            the topframe only, so only that frame gets reloaded ? By using the
            framename or something ?
            I could work around this by using a sessionflag that is cleared after the
            javascript is run, and set in the php script that does the uservalidation
            and issues a header(Location : mainFrame.php) but it's kind of ugly don't
            you think ?

            Thanx

            /ZW

            Comment

            • Kevin Thorpe

              #7
              Re: Got me a javaloop :-)

              ZoombyWoof wrote:
              [color=blue]
              > On Tue, 25 Nov 2003 10:27:50 +0000, Kevin Thorpe wrote:
              > *snip*
              >
              >[color=green]
              >>You'll have to resort to javascript (or vbscript <ugh!>) to do this.
              >>
              >>In the main frame you can insert the following if 'top' needs refreshing.
              >>
              >><script language="javas cript">
              >> window.parent.t op.location.rel oad();
              >></script>
              >>[/color]
              >
              > I tried this and then I get into a loop. This does exactly what pushing
              > the refresh button in IE does (I checked the apache access_log), it also
              > reloads the main frame where I inserted the java reload command, so it
              > reloads, and reloads and reloads...:-)
              >
              > THis is what refresh button in IE and the java script generates :
              > "GET /zwMD-UTV/ HTTP/1.1" 304 -
              > "GET /zwMD-UTV/leftFrame.html HTTP/1.1" 304 -
              > "GET /zwMD-UTV/topFrame.php HTTP/1.1" 200 554
              > "GET /zwMD-UTV/mainFrame.php HTTP/1.1" 200 442
              >
              >
              > I know absolutely nothing about javascript, is there some way to point out
              > the topframe only, so only that frame gets reloaded ? By using the
              > framename or something ?
              > I could work around this by using a sessionflag that is cleared after the
              > javascript is run, and set in the php script that does the uservalidation
              > and issues a header(Location : mainFrame.php) but it's kind of ugly don't
              > you think ?
              >[/color]
              sorry, I forgot 'top' was a reserved word. It's the outermost window
              (your frameset)

              <script language="javas cript">
              window.parent.t opFrame.locatio n.reload();
              </script>


              Comment

              • ZoombyWoof

                #8
                Re: Got me a javaloop :-)

                On Tue, 25 Nov 2003 12:03:50 +0000, Kevin Thorpe wrote:
                [color=blue]
                > ZoombyWoof wrote:
                >[color=green]
                >> On Tue, 25 Nov 2003 10:27:50 +0000, Kevin Thorpe wrote:
                >> *snip*
                >>
                >>[color=darkred]
                >>>You'll have to resort to javascript (or vbscript <ugh!>) to do this.
                >>>
                >>>In the main frame you can insert the following if 'top' needs refreshing.
                >>>
                >>><script language="javas cript">
                >>> window.parent.t op.location.rel oad();
                >>></script>
                >>>[/color]
                >>
                >> I tried this and then I get into a loop. This does exactly what pushing
                >> the refresh button in IE does (I checked the apache access_log), it also
                >> reloads the main frame where I inserted the java reload command, so it
                >> reloads, and reloads and reloads...:-)
                >>
                >> THis is what refresh button in IE and the java script generates :
                >> "GET /zwMD-UTV/ HTTP/1.1" 304 -
                >> "GET /zwMD-UTV/leftFrame.html HTTP/1.1" 304 -
                >> "GET /zwMD-UTV/topFrame.php HTTP/1.1" 200 554
                >> "GET /zwMD-UTV/mainFrame.php HTTP/1.1" 200 442
                >>
                >>
                >> I know absolutely nothing about javascript, is there some way to point out
                >> the topframe only, so only that frame gets reloaded ? By using the
                >> framename or something ?
                >> I could work around this by using a sessionflag that is cleared after the
                >> javascript is run, and set in the php script that does the uservalidation
                >> and issues a header(Location : mainFrame.php) but it's kind of ugly don't
                >> you think ?
                >>[/color]
                > sorry, I forgot 'top' was a reserved word. It's the outermost window
                > (your frameset)
                >
                > <script language="javas cript">
                > window.parent.t opFrame.locatio n.reload();
                > </script>[/color]

                Thanx a million :-) Now it works just like I want it :-))

                /ZoombyWoof

                Comment

                • André Næss

                  #9
                  Re: Refresh problem

                  ZoombyWoof:
                  [color=blue]
                  > Well, I have discovered that yes, but what if I still want my frames ? :-)
                  > It's quite nice to have a left frame so navigation gets easy, then I dont
                  > have to have links to everything on every page...and I want to be able to
                  > at all times see under what username I'm using the application without
                  > having to spell it out on every page...[/color]

                  You don't need frames to achieve any of those things. Just use PHP. All the
                  websites I've written in PHP consist of a single page (index.php), which
                  then selectively includes the rest of the site.

                  André Næss

                  Comment

                  • ZoombyWoof

                    #10
                    Re: Refresh problem

                    On Tue, 25 Nov 2003 13:28:30 +0000, André Næss wrote:
                    [color=blue]
                    > ZoombyWoof:
                    >[color=green]
                    >> Well, I have discovered that yes, but what if I still want my frames ? :-)
                    >> It's quite nice to have a left frame so navigation gets easy, then I dont
                    >> have to have links to everything on every page...and I want to be able to
                    >> at all times see under what username I'm using the application without
                    >> having to spell it out on every page...[/color]
                    >
                    > You don't need frames to achieve any of those things. Just use PHP. All the
                    > websites I've written in PHP consist of a single page (index.php), which
                    > then selectively includes the rest of the site.
                    >
                    > André Næss[/color]
                    You may be right, I'm not experienced enough in PHP or HTML to argue with
                    you, but why do a lot of people think Frames are a bad thing ? I find it
                    easy to navigate a site without having to click "Back" or try to find the
                    link that gets back to a index page or whatever...

                    This is maybe a religion thing, like C or C++, or Windows or Unix or...

                    /ZW

                    Comment

                    • André Næss

                      #11
                      Re: Refresh problem

                      ZoombyWoof:
                      [color=blue]
                      > You may be right, I'm not experienced enough in PHP or HTML to argue with
                      > you, but why do a lot of people think Frames are a bad thing ? I find it
                      > easy to navigate a site without having to click "Back" or try to find the
                      > link that gets back to a index page or whatever...[/color]

                      Because frames break the fundamental relationship between a URL and a
                      document. Ever tried to email a link to a framed document to someone?
                      "Well, uh, you go to this URL: http://www.example.com, and then you click
                      on 'Images'...". If frames hadn't been used you could just send
                      http://www.example.com/images instead.

                      If you think frames makes sites easier to navigate, that's just because the
                      non-frame pages were poorly designed in the first place.

                      André Næss

                      Comment

                      • Kevin Thorpe

                        #12
                        Re: Refresh problem

                        André Næss wrote:
                        [color=blue]
                        > ZoombyWoof:
                        >
                        >[color=green]
                        >>Well, I have discovered that yes, but what if I still want my frames ? :-)
                        >>It's quite nice to have a left frame so navigation gets easy, then I dont
                        >>have to have links to everything on every page...and I want to be able to
                        >>at all times see under what username I'm using the application without
                        >>having to spell it out on every page...[/color]
                        >
                        >
                        > You don't need frames to achieve any of those things. Just use PHP. All the
                        > websites I've written in PHP consist of a single page (index.php), which
                        > then selectively includes the rest of the site.[/color]

                        Confuses Google badly though doing that. I tend to prefer to let
                        documents stand on their own. That way I can hand styling and content
                        changes to the designers instead of doing it all myself.

                        document.php
                        <?php include('layout .lib'); ?>
                        <html>
                        <head>
                        <link rel="stylesheet " src="/style.css">
                        <?php layouthead(); ?>


                        </head>
                        <body>
                        <?php layouttop(); ?>
                        ....
                        ....
                        <?php layoutbottom(); ?>
                        </body>
                        </html>

                        Where layout.lib contains the three called functions to add div/tables
                        to frame the document. That way the designer can work on plain pages and
                        the users get them nicely framed. More importantly I don't have to look
                        at the crud that DreamWeaver puts in the HTML.

                        ....and finally. I have to do a browser check in layout.lib to avoid
                        adding the layout content for screen readers, lynx etc. When I used
                        frames this tended to fix itself as simple browsers didn't honour the
                        javascript to pop a document into the frameset.

                        Comment

                        • Geoff Berrow

                          #13
                          Re: Refresh problem

                          I noticed that Message-ID: <bpvilj$man$1@m aud.ifi.uio.no> from André
                          Næss contained the following:
                          [color=blue]
                          >Because frames break the fundamental relationship between a URL and a
                          >document. Ever tried to email a link to a framed document to someone?
                          >"Well, uh, you go to this URL: http://www.example.com, and then you click
                          >on 'Images'...". If frames hadn't been used you could just send
                          >http://www.example.com/images instead.[/color]

                          There are search engine and accessibility issues as well.

                          --
                          Geoff Berrow (put thecat out to email)
                          It's only Usenet, no one dies.
                          My opinions, not the committee's, mine.
                          Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                          Comment

                          • André Næss

                            #14
                            Re: Refresh problem

                            Kevin Thorpe:
                            [color=blue]
                            > André Næss wrote:
                            >[color=green]
                            >> ZoombyWoof:
                            >>
                            >>[color=darkred]
                            >>>Well, I have discovered that yes, but what if I still want my frames ?
                            >>>:-) It's quite nice to have a left frame so navigation gets easy, then I
                            >>>dont have to have links to everything on every page...and I want to be
                            >>>able to at all times see under what username I'm using the application
                            >>>without having to spell it out on every page...[/color]
                            >>
                            >>
                            >> You don't need frames to achieve any of those things. Just use PHP. All
                            >> the websites I've written in PHP consist of a single page (index.php),
                            >> which then selectively includes the rest of the site.[/color]
                            >
                            > Confuses Google badly though doing that. I tend to prefer to let
                            > documents stand on their own. That way I can hand styling and content
                            > changes to the designers instead of doing it all myself.[/color]

                            Not really, you can easily access articles as www.example.com/articles/2363
                            by extracting the variables from the url, and that way you maintain the
                            URL->Document relationship.

                            But are you sure Google isn't able to understand stuff like:
                            index.php?artic le=23. After all, this is a different URL from
                            index.php?artic le=24.

                            André Næss

                            Comment

                            • Richard Grove

                              #15
                              Re: Refresh problem

                              "ZoombyWoof " <zoombywoofremo ve@thishotmail. com> wrote in message
                              news:pan.2003.1 1.25.10.52.03.1 10275@thishotma il.com...[color=blue]
                              > On Tue, 25 Nov 2003 10:27:50 +0000, Kevin Thorpe wrote:
                              >[color=green]
                              > > ZoombyWoof wrote:
                              > >[color=darkred]
                              > >> Hi. I have a Framed page, and in the "main" frame a userchoise is made.[/color][/color][/color]
                              In[color=blue][color=green][color=darkred]
                              > >> my "top" frame I have a table containing some status info, the current
                              > >> logged on user (the username is saved in a SESSION variable) and some
                              > >> stuff like that. If I in the "main" frame change user (its a drop down
                              > >> list with choices from a MySQL DB) I would like to reflect that in the
                              > >> status row in the "top" frame. If I do a "header( Location[/color][/color][/color]
                              blablabla )",[color=blue][color=green][color=darkred]
                              > >> that page is shown in the "main" frame, which of course is not[/color][/color][/color]
                              desirable...[color=blue][color=green][color=darkred]
                              > >>
                              > >> If I hit the "Refresh" button in Internet Explorer, everything updates
                              > >> just fine, all the frames get updated and refreshed, including the[/color][/color][/color]
                              "top"[color=blue][color=green][color=darkred]
                              > >> frame with the new username showing. How do I do this refresh from[/color][/color][/color]
                              withing[color=blue][color=green][color=darkred]
                              > >> my php script that chooses a new user ? I have looked in the php-manual
                              > >> but havent been able to find anything about this.
                              > >>
                              > >> Any help would be very appreciated. I use PHP 4.3 on a RH 9.0 with[/color][/color][/color]
                              Apache[color=blue][color=green][color=darkred]
                              > >> 2.0.47
                              > >> Thanx.[/color]
                              > >
                              > > You'll have to resort to javascript (or vbscript <ugh!>) to do this.
                              > >
                              > > In the main frame you can insert the following if 'top' needs[/color][/color]
                              refreshing.[color=blue][color=green]
                              > >
                              > > <script language="javas cript">
                              > > window.parent.t op.location.rel oad();
                              > > </script>
                              > >
                              > > Using frames or not is sort-of a holy war. They are badly supported for
                              > > some browsers, especially screen readers for blind users etc. I try and
                              > > avoid using them for anything other than cosmetic reasons for the public
                              > > parts of my websites (convenient sidebar menu etc) in case they aren't
                              > > supported but rely on them heavily for web applications. Sometimes the
                              > > only way to make a usable app is to use framesets (Windows Explorer,
                              > > Outlook, Eudora etc).[/color]
                              >
                              > Thanx a lot. I will try the javascript method as soon as I can, No
                              > vbscript :-)
                              >
                              > /ZW
                              >[/color]


                              Not all users have javascript enabled.
                              As I said originally, ditch the frameset, it will save you time and effort
                              whilst providing a better site, not only for users, but for search engines.
                              If you are worried about providing the same nav on each page, simpley do a
                              nav.php file and include it in all pages.
                              include("nav,.p hp");


                              Regards
                              Richard Grove

                              http://shopbuilder.org - ecommerce systems
                              Become a Shop Builder re-seller:
                              Affiliate marketing is a simple way to earn money online, using our affiliate platform. Join a global community of publishers and advertisers.

                              Affiliate marketing is a simple way to earn money online, using our affiliate platform. Join a global community of publishers and advertisers.






                              ---
                              Outgoing mail is certified Virus Free.
                              Checked by AVG anti-virus system (http://www.grisoft.com).
                              Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003


                              Comment

                              Working...