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