php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20674 extra quotes added to page
Submitted: 2002-11-27 08:16 UTC Modified: 2002-11-27 08:24 UTC
From: tom dot schnittker at rexhealth dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.2.3 OS: Linux 7.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tom dot schnittker at rexhealth dot com
New email:
PHP Version: OS:

 

 [2002-11-27 08:16 UTC] tom dot schnittker at rexhealth dot com
I have the following line of code in a script:

echo "<input type=button value='View Report' onClick=window.open('./report1.php','_top') style='width: 200'>";

Which worked just fine.  I then added a session_register statement to the script:

<?
session_start();
echo "<input type=button value='View Report' onClick=window.open('./report1.php','_top') style='width: 200'>";
?>

The problem was that after this when the script processes for the first time the generated source code becomes:

<?
session_start();
echo "<input type=button value='View Report' onClick="window.open("'./report1.php','_top') style='width: 200'>";
?>

Note the spurious set of quotes around window.open(.  These quotes make the button inoperative.  If I do a refresh, the quotes disappear and it works fine.  I've made sure the browser cache is clear so I know that isn't the problem.  I've replicated the problem multiple times.

The problem could be browser related but if the same source is being sent each time from the Apache server, I'm not sure why the browser would interpret it differently on the initial load of the page as opposed to following a refresh.  Considering the browser is IE, anything is possible.

'./configure' '--with-mysql=/usr/local/mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-bcmath' '--with-gd' '--enable-sockets' '--enable-track-vars' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/local/lib' '--with-zlib-dir=/usr/lib' '--with-png' '--with-ttf'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-27 08:24 UTC] jan@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. 

Thank you for your interest in PHP.

you don\'t write standard conform HTML, that might confuse the trans-sid parser. try:

<?
session_start();
echo <<< EOT
<input type=\"button\" value=\"View Report\"
onClick=\"window.open(\'./report1.php\',\'_top\')\" style=\"width: 200\">
EOT;
?>


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC