Closed
Bug 294220
Opened 20 years ago
Closed 2 months ago
sending queries twice for PHP application
Categories
(Core :: Networking, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: angie_khushrenada, Unassigned)
References
()
Details
User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 Build Identifier: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 I frequent some sites that use applications built on PHP, and queries are being sent twice. On Subeta's games Reflection (http://subeta.org/games/reflection.php) and Fishing (http://subeta.org/games/fishing.php), when you click on a square Firefox sends the request twice. This results in me losing a move in each game. I can also reproduce this issue when I post on the phpBB board at http://www.technoangel.net/marauders/forum . Whenever someone posts a message and uses the Firefox browser, an error message comes up because Firefox sends the PHP request twice. Reproducible: Always Steps to Reproduce: For Subeta's games Reflection and Fishing: 1. Click on link to the game 2. Start playing game 3. Notice how many moves have occurred in the game after you click ONCE on the square For Marauding Mayhem's phpBB board: 1. Go to the message board at this URL: http://www.technoangel.net/marauders/forum 2. post a message on any of the threads Actual Results: Reflection and Fishing: instead of using only one move, the game registers that two moves have taken place. Marauding Mayhem forum: error message page appears instead of the thread topic with new post added Expected Results: Sent the php request only one time instead of two. I use a custom theme, but the bug has been a problem with the default theme as well.
Yes, I have noticed this aswell. When I use an include or require script in PHP it will do it twice which results in many problems for my site. This is a very serious, but hard-to-notice error, it wastes database bandwidth for lots of site (this means Firefox users use up 2x more than others).
Comment 2•19 years ago
|
||
Same thing happens to me! At first I thought it was a server-side bug, but it really is Firefox. No other browser does that, plus "Ethereal - Network Protocol Analyzer" confirms that the page request is being sent out twice. Unfortunately, I don't know what is so special about the pages which are loaded twice. When I press F5, the page is reloaded only once. But with Ctrl+F5 it is again loaded twice. I sure hope someone fixes this soon!
Comment 3•19 years ago
|
||
I did some more testing on this: I tested this on more than one computer and the results were the same - the query is sent twice. And the "Waiting for..." clearly appears once, then for a very short moment "Stopped" appears (I did a screan shot to make sure) and then the page is loaded again. Same problem appeared when I removed all parameters from the php query. One think that could be worth noting is: I was outputing stuff before <html>. When I changed it so that nothing is outputed before <html>, then the query was recieved only once.
Comment 4•19 years ago
|
||
In the stuff before html there was a javascript code. The problem did not appear when javascript code was removed. I am almost sure that the reason is somewhere in the javascript parsing. Still, no idea what exactly.
I have noticed this bug on a website I maintain. It occurs when a peage uses PHP's header() function to change the content-type to display an image (and maybe others).
example PHP code:
<?php
header("Content-type: image/gif");
readfile('pixel.gif');
?>
The same occurs using imagecreate() and fopen() to create the image (in png and jpeg). This is new from Firefox 1.5. The only method I have found to make one call only is by not sending the image content (just change the header) but this is far from ideal.
Server: Apache/2.0.46 (Red Hat)
X-Powered-By: PHP/4.3.11
Apache Log:
192.168.254.18 - - [02/Feb/2006:15:17:07 +0000] "GET /headertest.php HTTP/1.1" 200 42
192.168.254.18 - - [02/Feb/2006:15:17:07 +0000] "GET /headertest.php HTTP/1.1" 200 42
Http Live headers also confirms the call is made twice.I can confirm this is happening. In my case its when I define my own http header and dump a raw png image. If I remove either of the the two lines firefox will only do one http request. Of cource the app breaks as well. So now I have to let my firefox 1.5 users hit my servers twice for each issue. I can also verify that this does not happen on IE.
header ("Content-Type: image/png");
imagepng($dest_im);
I'm suprised no one has picked this bug up since it seems like a big deal. Is there a work around in the php code that anyone knows?Just to let everyone no. I manully added a etag and last-modified to the http headers and that seemed to fix the issue.
$file_hash = md5_file($post_abs);
header("Etag: \"$file_hash\"");
header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($post_abs)).' GMT');
Good Luck
Comment 8•18 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1) Gecko/20061010 Firefox/2.0 Hi, I am using Firefox 2.0: Could it be, that this bug isn't fixed yet??
Updated•18 years ago
|
Product: Firefox → Core
QA Contact: general → general
Updated•2 years ago
|
Severity: normal → S3
Comment 9•2 months ago
|
||
Moving this to a more proper component than Core:General. I am not sure if this is still valid, likely not... ?
Severity: S3 → --
Component: General → Networking
Comment 10•2 months ago
|
||
I tried to reproduce with the steps in Comment 5 and Comment 6, but no luck.
And since the originally reported websites are no longer up I'm going to close this.
This was probably fixed long ago, but if someone has a way to reproduce please re-open or create a new bug.
Status: UNCONFIRMED → RESOLVED
Closed: 2 months ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•