Re: Strange problem 'window.open'

From: Date: Wed, 17 Apr 2002 14:23:38 +0000
Subject: Re: Strange problem 'window.open'
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-13139@lists.php.net to get a copy of this message
You are using php inside a javascript code without the <?php ?> tags! change the problem line as below and it may work window.open('totale.php?IDT= "'+ <?= $IDT?> + '"','leftframe');"; // <--- !!! here is the problem !!! R'twick ----- Original Message ----- From: "Fabio" <mind@zolnetwork.com> To: <php-windows@lists.php.net> Sent: Wednesday, April 17, 2002 10:16 AM Subject: [PHP-WIN] Strange problem 'window.open' > This is my page: > ---------------------- > <html> > <head> > <script language = "Javascript" src="general.js"></script> > </head> > <body> > <? > include "general.php"; > include "param.php"; > > if (!($conn=mssql_connect($DBserver, $DBusername, $DBpassword))) { > die("Errore di connessione al server"); > } > > if (!(mssql_select_db($DBdatabase, $conn))) { > die("Errore di connessione al database"); > } > > $sql="SELECT * FROM TEMPORANEA WHERE IDT=".$IDT; > if (!($result=mssql_query($sql, $conn))) { > die("Errore nella query ".$sql); > } > $datarecord=mssql_fetch_array($result); > ?> > <form name="theform" method="POST" action="input.php"> > <table width=100% border=0 cellspacing=0 cellpadding=0> > <tr> > <td> > <? here some php code to display $datarecord[...] ?> > </td> > </tr> > </table> > </form> > <? > $sql="UPDATE mytable SET myfield1=1,myfield2=2"; > > if (!($result=mssql_query($sql, $conn))) { > die("Errore nella query ".$sql); > } > > mssql_close($conn); > ?> > <script> > window.open('totale.php?IDT=".$IDT."','leftframe');"; // > <--- !!! here is > the problem !!! > </script> > </body> > </html> > ---------------------- > > > The marked line should open the php page in 'leftframe' frame: some time > this is not done and I get the error: > > ---------------- > CGI Error > The specified CGI application misbehaved by not returning a complete set of > HTTP headers. The headers it did return are: > ---------------- > > I try to reload the main page and 'totale.php' is opened in the right way. > The problem seems to be is in the window.open that sometimes loads the wrong > page or none. If I put an alert('test'); befone the window.open, that window > is opened *always*. > > Is there some setting to look for in php.ini or this method to open windows > is not correct? > > > Thanx, Fabio > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.windows (#13139) next »