|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-11-27 08:24 UTC] jan@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Jan 03 02:00:01 2026 UTC |
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'