Edit report at http://bugs.php.net/bug.php?id=54637&edit=1
ID: 54637 Updated by: [email protected] Reported by: thomas dot roberts at texaswww dot net Summary: Null src value causes script to run twice -Status: Open +Status: Bogus Type: Bug Package: Scripting Engine problem Operating System: Debian PHP Version: 5.2.17 Block user comment: N Private report: N 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: ------------------------------------------------------------------------ [2011-04-29 22:17:59] thomas dot roberts at texaswww dot net Makes sense. Thank you. ------------------------------------------------------------------------ [2011-04-29 22:13:53] 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 21:38:53] 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> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54637&edit=1
