#36476 [Opn->Bgs]: fwrite count by 2 with img src=""
| From: | mike@php.net | Date: | Tue, 21 Feb 2006 22:12:22 +0000 |
| Subject: | #36476 [Opn->Bgs]: fwrite count by 2 with img src="" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93498@lists.php.net to get a copy of this message | ||
ID: 36476
Updated by: mike@php.net
Reported By: mdulay at millersville dot edu
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: Solaris 10/ HPUX 11
PHP Version: 5.1.2
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2006-02-21 15:22:09] mdulay at millersville dot edu
Description:
------------
The issue occurs on both PHP4 and PHP5 and on 2 different OS, HPUX 11
and Solaris 10. I have a simple counter that reads a file adds 1 and
rewrites the file. After a good bit of frustration I found that there
was a missing img src="" in the HTML. It didn't matter where the PHP
was whether it preceeded the HTML or was inline, the counter still
added 2 each time it was called upon. Of course I have fixed the HTML,
however the tie between a missing image and the PHP has me perplexed.
The code I have attached has been simplified the situation however the
initial code was using includes and the missing image was not easily
detected.
Reproduce code:
---------------
<?
$counterfile="count.txt";
$conn=fopen($counterfile,'r');
$count=trim(fgets($conn));
echo ":".$count.":";
++$count;
fclose($conn);
$conn=fopen($counterfile,'w');
fwrite($conn,$count);
fclose($conn);
echo ":".$count.":";
?>
<html>
<body>
<img src="" >
</body>
</html>
Expected result:
----------------
A missing image with a counter that increments by 1.
Actual result:
--------------
Counter that has incremented by 2 and a missing image.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36476&edit=1