Re: Mystery quotes

From: Date: Tue, 13 Feb 2001 15:52:09 +0000
Subject: Re: Mystery quotes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39433@lists.php.net to get a copy of this message
What about just forcing the use of escaped quotes? Have you tried that? instead of: echo " document.write(\"<td><input type=text size=9 value='\" +\n"; try: echo " document.write(\"<td><input type=\"text\" size=\"9\" value='\" +\n"; - John Vanderbeck - Admin, GameDesign ----- Original Message ----- From: "John Hofstad-Parkhill" <jhparkhill@qwest.net> To: <php-general@lists.php.net> Sent: Tuesday, February 13, 2001 10:38 AM Subject: [PHP] Mystery quotes > I'm encountering the following problem and now wonder if it's related to > magic quotes. > > The code in the current, non-working form. Please note that for the > <input..> there are no quotes or apostropies around the word "text" the size > of 9, the name of proj[]. > **************************************************************************** > ******************* > echo " <script language=\"JavaScript\">\n"; > echo " <!-- // hide from older browsers\n"; > > echo " var cell = 0;\n"; > echo " var temp;\n"; > > echo " for (row = 0; row < tasksOnPage; row++)\n"; > echo " {\n"; > echo " document.write(\"<tr>\" +\n"; > echo " \"<font size=2 face=arial>\");\n"; > > echo " temp = Proj[row];\n"; > echo " if (temp == \"\")\n"; > echo " temp = \"(default)\";\n"; > echo " document.write(\"<td><input type=text size=9 value='\" > +\n"; > echo " temp +\n"; > echo " \"' name=proj[] notab > readonly></td>\");\n"; > > echo " if (temp == \"(default)\")\n"; > echo " temp = \"Requirement \" + Rqmt[row];\n"; > echo " else\n"; > echo " temp = Desc[row];\n"; > **************************************************************************** > ***************** > This is the "View Source" from the browser (MSIE 5.5) output when the > display is correct: > > > <script language="JavaScript"> > <!-- // hide from older browsers > var cell = 0; > var temp; > for (row = 0; row < tasksOnPage; row++) > { > document.write("<tr>" + > "<font size=2 face=arial>"); > temp = Proj[row]; > if (temp == "") > temp = "(default)"; > document.write("<td><input type=text size=9 value='" + > temp + > "' name=proj[] notab readonly></td>"); > if (temp == "(default)") > temp = "Requirement " + Rqmt[row]; > else > temp = Desc[row]; > **************************************************************************** > **************** > Note the <input type=text size=9... > > Now look at the cache'd version that comes up when I View Source: > (the page comes up in error, so I select View | Source from the MSIE menu) > and get the following text: > **************************************************************************** > **************** > > <script language="JavaScript"> > <!-- // hide from older browsers > var cell = 0; > var temp; > for (row = 0; row < tasksOnPage; row++) > { > document.write("<tr>" + > "<font size=2 face=arial>"); > temp = Proj[row]; > if (temp == "") > temp = "(default)"; > document.write("<td><input type="text" size="9" > value="" + > temp + > "" name="proj[]" notab readonly></td>"); > if (temp == "(default)") > temp = "Requirement " + Rqmt[row]; > else > temp = Desc[row]; > **************************************************************************** > ********************** > Somebody, somewhere, somehow inserted double quotes around type, size, name > and value. This fails miserably. The only way I can make it go away is to > delete all temporary internet files. > > The snippet meta... expires 0 is part of these pages. > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#39433) next »