note 47793 added to function.htmlspecialchars

From: Date: Tue, 30 Nov 2004 15:43:44 +0000
Subject: note 47793 added to function.htmlspecialchars
Groups: php.notes 
Request: Send a blank email to php-notes+get-81184@lists.php.net to get a copy of this message
Sorry didnt see the note. Cheers Mr Webmaster. Hi Im reading a string using php from a db and trying to add into a text field. The user can then edit this and save back to the db. Ive used 'mysql_real_escape_string' to write special characters back to the db but how do I use 'htmlspecialchars' to read from the db keeping the special characters in the format: printf(" <tr> "); printf(" <td nowrap align='left' width='140'>Weight</td> "); printf(" <td align='left' width='400'> <input type='text' name=heightrows='1' size='50' value='%s'> </td>", $RiderRow[Height]); printf(" </tr> "); The Height can be saved successfully as 5'8" but cant be read properly as the html gets confused with the ' and " Any ideas would be appreciated. Thanks. Darren Rhymer ---- Manual Page -- http://www.php.net/manual/en/function.htmlspecialchars.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47793 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47793&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47793&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47793&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47793&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47793&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47793&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47793&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81184) next »