RE: [PHP] Mystery quotes

From: Date: Tue, 13 Feb 2001 15:49:17 +0000
Subject: RE: [PHP] Mystery quotes
Groups: php.general 
Request: Send a blank email to php-general+get-39432@lists.php.net to get a copy of this message
Presumably if you have <input type=\"text\" size=\"9\"... in your script, that doesn't work either? Incidentally, you can use Shift-Refresh to force a server refresh in IE (saves you deleting everything next time!) HTH Jon -----Original Message----- From: John Hofstad-Parkhill [mailto:jhparkhill@qwest.net] Sent: 13 February 2001 15:38 To: php-general@lists.php.net 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 (#39432) next »