468,249 Members | 1,448 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

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
Jul 17 '05 #1
5 1411
Paul Eden wrote:

Hi Paul,
Afternoon all.
I wonder if someone might lend a little hand here?
Of course, this is the most friendly NG you'll ever find. :-)

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.
That is by POSTing, right?
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.
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.


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

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?
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.close();">
</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.

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


hope this helped.

Regards,
Erwin Moller
Jul 17 '05 #2
Paul Eden wrote:
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
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.
so, at the bottom of update.php, there is an
image which has a javascript onload command, that loads up update.php.
That sounds ugly. You've got a page that loads itself into an image? What
for?
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.
Why is your screen full of browsers?
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
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.
or should
I be thinking about how to make update.php close itself after the
javascript onload has executed?
I don't understand what you're doing here. Sorry :-(
Any guidance on which route, or any other for that matter and how I
might implement them would be greatly appreciated


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

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 17 '05 #3
Erwin Moller <si******************************************@spam yourself.com> wrote in message news:<42*********************@news.xs4all.nl>...
Paul Eden wrote:

Hi Paul,
Afternoon all.
I wonder if someone might lend a little hand here?
Of course, this is the most friendly NG you'll ever find. :-)

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.


That is by POSTing, right?


<form method=get action="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.
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.

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!

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.
Why is that happening?
If you submit the form, did you gave a certain target (= new window)???


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?

if your target is the same name, the same window will be recycled.
The new result of update.php will be displayed.

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?
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.close();">
</body>
</html>

should do the trick.

It's not producing any meaningful output. Mostly debugg stuff that I
haven't got around to removing yet.
Question reference onload="self.close". 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.

Maybe it is less irritating for the client if you do not create a new window
every time, but use a frameset, or IFrame.
Yes. Good point. I'll look into that.

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


hope this helped.

Regards,
Erwin Moller


Indeed it did. Many thanks Erwin,

Paul
Jul 17 '05 #4
Philip Ronan <in*****@invalid.invalid> wrote in message news:<BE6F4B0B.2D2A9%in*****@invalid.invalid>...
Paul Eden wrote:
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


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.
so, at the bottom of update.php, there is an
image which has a javascript onload command, that loads up update.php.


That sounds ugly. You've got a page that loads itself into an image? What
for?
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.


Why is your screen full of browsers?
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


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.
or should
I be thinking about how to make update.php close itself after the
javascript onload has executed?


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


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


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.
Jul 17 '05 #5
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>

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Michael J. Moore | last post: by
2 posts views Thread by TonyJeffs | last post: by
16 posts views Thread by Harlan Messinger | last post: by
5 posts views Thread by Steve | last post: by
133 posts views Thread by Alan Silver | last post: by
6 posts views Thread by Tarun Mistry | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.