Re: how do I?

From: Date: Thu, 06 Sep 2001 08:51:30 +0000
Subject: Re: how do I?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-66167@lists.php.net to get a copy of this message
onMouseOver="info(<? $xline=__LINE__; Dunno, should this be: onMouseOver="info('<? $xline=__LINE__;.....') instead? I mean I see no quotes surrounding the javascript string (that is generated from PHP). "Adrian D'Costa" <adrian@pcsadvt.com> wrote in message news:Pine.LNX.4.21.0109061007550.7741-100000@pcs.pcsadvt.com... > Hi, > > I am trying to write a dynamic help module based on a mysql database. I > am using Javascript and PHP to do this. > > This is part of my script (both java and php) > > <script language="JavaScript"> > <!-- > > function info(theline) > { > w > w=window.open("","test","screenx=10,screeny=10,width=350,height=80,,scrollba rs=no"); > w.document.open(); > w.document.writeln("<PRE>"); > w.document.writeln("File Name: " + thename); > w.document.writeln("Description: " + theline); > w.document.writeln("</PRE>"); > w.document.close(); > > > } > > //--> > </script> > <p align="center"></font><a > href="offerte.html" onMouseOver="info(<? $xline=__LINE__; > > require("user.php"); > require("error.php"); > $newuser = new user(); > > $nerror= new error(); > $xfile=explode("/", __FILE__); > $num=sizeof($xfile); > $fname=$xfile[$num-1]; > // Sql Statement > > $searchStmt = "select * from help where fnumber=$xline and > fname='$fname'"; > > //execute the statement for help > > if(!$result=mysql_query($searchStmt, $newuser->link)) > { > $xerror = $nerror->error1(202); > print($xerror); > exit(); > }else{ > $num=mysql_num_rows($result); > if ($num==0) > { > $xerror = $nerror->error1(300); > print($xerror); > exit(); > } else { > $row=mysql_fetch_object($result); > } > } > $xdetail = nl2br($row->hdetail); > echo "$xdetail"; > ?>);"> > > This script works if I have a single line the hdetail field, but if I put > multiply lines in the hdetail field nothing shows up. I added nl2br but > nothing work, if you view the source in netscape it is there with the > </br>. I am sure I am doing something wrong, but where I don't know. Can > some one correct me? > > TIA > > Adrian >

« previous php.general (#66167) next »