note 74863 added to faq.html

From: Date: Tue, 01 May 2007 12:14:52 +0000
Subject: note 74863 added to faq.html
Groups: php.notes 
Request: Send a blank email to php-notes+get-126015@lists.php.net to get a copy of this message
Actually Example 56.1 doesn't conform to what is stated in the text above it, namely: * HTML interpretation. In order to specify a random string, you must include it in double quotes, and htmlspecialchars() the whole value. In the example code single quotes are used instead of double quotes: <?php echo "<input type='hidden' value='" . htmlspecialchars($data) . "' />\n"; ?> which should be instead: <?php echo "<input type='hidden' value=\"" . htmlspecialchars($data) . "\" />\n"; ?> If single quotes are used, they should be escaped too using ENT_QUOTES quote style for htmlspecialchars. ---- Server IP: 69.147.83.197 Probable Submitter: 89.55.94.11 ---- Manual Page -- http://www.php.net/manual/en/faq.html.php Edit -- https://master.php.net/note/edit/74863 Del: integrated -- https://master.php.net/note/delete/74863/integrated Del: useless -- https://master.php.net/note/delete/74863/useless Del: bad code -- https://master.php.net/note/delete/74863/bad+code Del: spam -- https://master.php.net/note/delete/74863/spam Del: non-english -- https://master.php.net/note/delete/74863/non-english Del: in docs -- https://master.php.net/note/delete/74863/in+docs Del: other reasons-- https://master.php.net/note/delete/74863 Reject -- https://master.php.net/note/reject/74863 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126015) next »