get spawns loads of browsers.. solution?

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

    get spawns loads of browsers.. solution?

    Afternoon all.
    I wonder if someone might lend a little hand here?

    I'm using input.htm to take some data using radio and a text field
    from the user, which then "get"s them to update.php.
    Now then, there is a lot of data to input, so i need to go back to
    input.htm repeatedly, so, at the bottom of update.php, there is an
    image which has a javascript onload command, that loads up update.php.

    You probably know where this is going by now? After a short while, I
    end up with a screen full of browsers and it's annoying me.

    What is my best way forward here? Can I make pass the data from
    input.htm to update.php without it firing up a new browser, or should
    I be thinking about how to make update.php close itself after the
    javascript onload has executed?

    Any guidance on which route, or any other for that matter and how I
    might implement them would be greatly appreciated
  • Erwin Moller

    #2
    Re: get spawns loads of browsers.. solution?

    Paul Eden wrote:

    Hi Paul,
    [color=blue]
    > Afternoon all.
    > I wonder if someone might lend a little hand here?[/color]

    Of course, this is the most friendly NG you'll ever find. :-)
    [color=blue]
    >
    > I'm using input.htm to take some data using radio and a text field
    > from the user, which then "get"s them to update.php.[/color]

    That is by POSTing, right?
    [color=blue]
    > Now then, there is a lot of data to input, so i need to go back to
    > input.htm repeatedly, so, at the bottom of update.php, there is an
    > image which has a javascript onload command, that loads up update.php.[/color]

    What do you mean?
    Is the form submitted by the user pressing a submit-button (or image), or is
    the form submitted automatically by some onLoad-event?

    If the latter, you need to explain why, because that is confusing (to me).
    Why?
    Because I do not see the point in submitting a form when the client didn't
    fill it first.

    [color=blue]
    >
    > You probably know where this is going by now? After a short while, I
    > end up with a screen full of browsers and it's annoying me.[/color]

    Why is that happening?
    If you submit the form, did you gave a certain target (= new window)???

    if your target is the same name, the same window will be recycled.
    The new result of update.php will be displayed.
    [color=blue]
    >
    > What is my best way forward here? Can I make pass the data from
    > input.htm to update.php without it firing up a new browser, or should
    > I be thinking about how to make update.php close itself after the
    > javascript onload has executed?[/color]

    Yes, that is a solution.
    I take it your update.php is not producing any relevant output?
    In that case, just let JS close the window.

    <html>
    <body onLoad="self.cl ose();">
    </body>
    </html>

    should do the trick.

    Maybe it is less irritating for the client if you do not create a new window
    every time, but use a frameset, or IFrame.
    [color=blue]
    >
    > Any guidance on which route, or any other for that matter and how I
    > might implement them would be greatly appreciated[/color]

    hope this helped.

    Regards,
    Erwin Moller

    Comment

    • Philip Ronan

      #3
      Re: get spawns loads of browsers.. solution?

      Paul Eden wrote:
      [color=blue]
      > I'm using input.htm to take some data using radio and a text field
      > from the user, which then "get"s them to update.php.
      > Now then, there is a lot of data to input, so i need to go back to
      > input.htm repeatedly[/color]

      Then why don't you use a php file (let's call it "input.php" ) that submits
      the data to itself. That way you can enter a new set of data straight away
      while the server gets on with whatever process it has to do. If you like,
      you can get the server to populate the form with the data you entered last
      time you submitted it.
      [color=blue]
      > so, at the bottom of update.php, there is an
      > image which has a javascript onload command, that loads up update.php.[/color]

      That sounds ugly. You've got a page that loads itself into an image? What
      for?
      [color=blue]
      > You probably know where this is going by now? After a short while, I
      > end up with a screen full of browsers and it's annoying me.[/color]

      Why is your screen full of browsers?
      [color=blue]
      > What is my best way forward here? Can I make pass the data from
      > input.htm to update.php without it firing up a new browser[/color]

      Do you mean without opening a new window? This won't happen if you avoid
      using javascript pop-ups and target attributes in your links.
      [color=blue]
      > or should
      > I be thinking about how to make update.php close itself after the
      > javascript onload has executed?[/color]

      I don't understand what you're doing here. Sorry :-(
      [color=blue]
      > Any guidance on which route, or any other for that matter and how I
      > might implement them would be greatly appreciated[/color]

      Could you provide a URL so we can see what you're trying to do?

      --
      phil [dot] ronan @ virgin [dot] net



      Comment

      • Paul Eden

        #4
        Re: get spawns loads of browsers.. solution?

        Erwin Moller <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in message news:<4249711d$ 0$146$e4fe514c@ news.xs4all.nl> ...[color=blue]
        > Paul Eden wrote:
        >
        > Hi Paul,
        >[color=green]
        > > Afternoon all.
        > > I wonder if someone might lend a little hand here?[/color]
        >
        > Of course, this is the most friendly NG you'll ever find. :-)
        >[color=green]
        > >
        > > I'm using input.htm to take some data using radio and a text field
        > > from the user, which then "get"s them to update.php.[/color]
        >
        > That is by POSTing, right?[/color]

        <form method=get action="update. php">
        [color=blue]
        >[color=green]
        > > Now then, there is a lot of data to input, so i need to go back to
        > > input.htm repeatedly, so, at the bottom of update.php, there is an
        > > image which has a javascript onload command, that loads up update.php.[/color]
        >
        > What do you mean?
        > Is the form submitted by the user pressing a submit-button (or image), or is
        > the form submitted automatically by some onLoad-event?
        >
        > If the latter, you need to explain why, because that is confusing (to me).
        > Why?
        > Because I do not see the point in submitting a form when the client didn't
        > fill it first.
        >[/color]
        The user presses the form object "submit". I mention the onload
        command because it's used to *reopen* the input.htm (not update.php
        like I previously said). You were rightly confused!
        [color=blue]
        >[color=green]
        > >
        > > You probably know where this is going by now? After a short while, I
        > > end up with a screen full of browsers and it's annoying me.[/color]
        >
        > Why is that happening?
        > If you submit the form, did you gave a certain target (= new window)???[/color]

        I used default (in other words, I didn't specify a target) , which
        presumably is new window. If its possible to specify self, this may be
        the solution?
        [color=blue]
        >
        > if your target is the same name, the same window will be recycled.
        > The new result of update.php will be displayed.
        >[color=green]
        > >
        > > What is my best way forward here? Can I make pass the data from
        > > input.htm to update.php without it firing up a new browser, or should
        > > I be thinking about how to make update.php close itself after the
        > > javascript onload has executed?[/color]
        >
        > Yes, that is a solution.
        > I take it your update.php is not producing any relevant output?
        > In that case, just let JS close the window.
        >
        > <html>
        > <body onLoad="self.cl ose();">
        > </body>
        > </html>
        >
        > should do the trick.[/color]
        It's not producing any meaningful output. Mostly debugg stuff that I
        haven't got around to removing yet.
        Question reference onload="self.cl ose". Can I be assured that the
        browser will close *after* it's php has executed?
        I did try having an image at the bottom of the page. Having used an
        image with an onload behaviour (dreamweaver) to fire up input.htm, I
        tried to add another image below it with onload self close.
        Unfortunately it produced an error. Not from the parser, but in the
        status bar, I got the little yellow ! mark. I clikced it and
        ;"Problems with this webpage may prevent it displaying properly blah
        blah." "Error at line 5, object expected."
        Line 5 is where I put a pragma meta tag to prevent caching (to make
        sure the images loaded last). Most odd.
        [color=blue]
        >
        > Maybe it is less irritating for the client if you do not create a new window
        > every time, but use a frameset, or IFrame.[/color]

        Yes. Good point. I'll look into that.
        [color=blue]
        >[color=green]
        > >
        > > Any guidance on which route, or any other for that matter and how I
        > > might implement them would be greatly appreciated[/color]
        >
        > hope this helped.
        >
        > Regards,
        > Erwin Moller[/color]

        Indeed it did. Many thanks Erwin,

        Paul

        Comment

        • Paul Eden

          #5
          Re: get spawns loads of browsers.. solution?

          Philip Ronan <invalid@invali d.invalid> wrote in message news:<BE6F4B0B. 2D2A9%invalid@i nvalid.invalid> ...[color=blue]
          > Paul Eden wrote:
          >[color=green]
          > > I'm using input.htm to take some data using radio and a text field
          > > from the user, which then "get"s them to update.php.
          > > Now then, there is a lot of data to input, so i need to go back to
          > > input.htm repeatedly[/color]
          >
          > Then why don't you use a php file (let's call it "input.php" ) that submits
          > the data to itself. That way you can enter a new set of data straight away
          > while the server gets on with whatever process it has to do. If you like,
          > you can get the server to populate the form with the data you entered last
          > time you submitted it.
          >[color=green]
          > > so, at the bottom of update.php, there is an
          > > image which has a javascript onload command, that loads up update.php.[/color]
          >
          > That sounds ugly. You've got a page that loads itself into an image? What
          > for?
          >[color=green]
          > > You probably know where this is going by now? After a short while, I
          > > end up with a screen full of browsers and it's annoying me.[/color]
          >
          > Why is your screen full of browsers?
          >[color=green]
          > > What is my best way forward here? Can I make pass the data from
          > > input.htm to update.php without it firing up a new browser[/color]
          >
          > Do you mean without opening a new window? This won't happen if you avoid
          > using javascript pop-ups and target attributes in your links.
          >[color=green]
          > > or should
          > > I be thinking about how to make update.php close itself after the
          > > javascript onload has executed?[/color]
          >
          > I don't understand what you're doing here. Sorry :-(
          >[color=green]
          > > Any guidance on which route, or any other for that matter and how I
          > > might implement them would be greatly appreciated[/color]
          >
          > Could you provide a URL so we can see what you're trying to do?[/color]

          Yeah, sorry. I'm not being very clear. Let me start again.

          In a FPS game my clan plays and the game awards points. I wanted to
          take the points awarded and make a league, so we could see who was
          best.

          So, I have input.htm, which has a form. Firstly, the user selects
          which player they are entering a score for (radio button) then a
          textspace to enter the score. When they click submit, input.htm sends
          the playerid and score to update.php, which reads the player/score
          datafile and writes it back to disk.

          Now. update.php has, at the bottom of the page, an image, with a
          javascript onload command that tells is to reload input.htm, as there
          as more scores to enter.

          The problem is, that the onload fires up a new browser, when I'd like
          it to be in the same one. My current form of attack is to use the
          <body close> as suggested earlier, to automatically close update.php.
          This does sort of have the required effect, except that as the new
          browser opens and the old one closes, it "marches" across the screen.

          Obviously, this is pretty inelegant. Ideally, the java onload would be
          told to use itself as a target browser.

          Comment

          • rich

            #6
            Re: get spawns loads of browsers.. solution?

            It sounds like you're making this WAY too hard. You can just have the
            page submit to itself. i'd just put at the very top of the page:

            <?php
            if ($submit) {
            //enter scores...
            }
            ?>

            then

            <form action="<?php echo $PHP_SELF; ?>" method="post">
            .... form stuff...
            <input type=submit name=submit value=submit>
            </form>

            Comment

            Working...