note 47793 rejected from function.htmlspecialchars by cece

From: Date: Tue, 30 Nov 2004 16:21:56 +0000
Subject: note 47793 rejected from function.htmlspecialchars by cece
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-81186@lists.php.net to get a copy of this message
Note Submitter: darren_rhymer at hotmail dot com ---- 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

« previous php.notes (#81186) next »