php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54637 Null src value causes script to run twice
Submitted: 2011-04-29 21:38 UTC Modified: 2011-04-30 18:48 UTC
From: thomas dot roberts at texaswww dot net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.17 OS: Debian
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: thomas dot roberts at texaswww dot net
New email:
PHP Version: OS:

 

 [2011-04-29 21:38 UTC] thomas dot roberts at texaswww dot net
Description:
------------
PHP Version 5.2.6-1+lenny10
System Linux mycomputer 2.6.26-2-amd64 #1 SMP Tue Jan 25 05:59:43 UTC 2011 x86_64

Output:
1

Page Source:
<html><head><script type='text/javascript' src=''></script></head><body>2</body></html>

* Leaving the script src='' (See code below) causes the entire script to run twice, thus causing the session variable to double increment.
* The page source will show a value +1 higher than displayed value
* [Refresh] will output '3', then '5', ... with the Page Source showing '4', '6', ...
* Adding a valid src file prevents the bug

Test script:
---------------
<?php
session_start();
++$_SESSION['count'];
echo "<html><head>";
echo "<script type='text/javascript' src=''></script>";
echo "</head><body>";
echo $_SESSION['count'];
echo "</body></html>";
?>

Expected result:
----------------
Output:
1

Page Source:
<html><head><script type='text/javascript' src=''></script></head><body>1</body></html>


The script should only run once.  The page source should match the actual page output.

Actual result:
--------------
Output:
1

Page Source:
<html><head><script type='text/javascript' src=''></script></head><body>2</body></html>

[Page Refresh]

Output:
3

Page Source:
<html><head><script type='text/javascript' src=''></script></head><body>4</body></html>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-29 22:13 UTC] felipecg00 at gmail dot com
Well it's just sending another request to the same address.

Not a bug neither PHP related I guess.
 [2011-04-29 22:17 UTC] thomas dot roberts at texaswww dot net
Makes sense.  Thank you.
 [2011-04-30 02:49 UTC] cataphract@php.net
-Status: Open +Status: Bogus
 [2011-04-30 02:49 UTC] cataphract@php.net
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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Dec 07 21:00:01 2025 UTC