[thelist] Dealing with special characters in forms

Michael Caplan michael at eggplant.ws
Fri Jan 3 12:16:00 CST 2003


I'm having a problem with a form filled textarea and special characters.
When the form is submitted to be parsed by a PHP script, all the special
character entities are presented to the script as translated text.

An example:

The user is presented with a form that has the following predefined

<textarea id="b88" name="body[88]" cols="72" rows="12">
<p>&pound; &lt;= crazy</p>

When the form is submitted, the data in the textarea is translated so that
the special character codes are replaced with there text equivalent.

The weird thing is if the user is presented with a blank textarea and they
enter "<p>&pound; &lt;= crazy</p>", the browser will retain the special
character codes.

So... the million dollar question: How do you ensure that your special
characters are maintained in there encoded format upon submission?



PS - for what it is worth, my page uses the following character set:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

More information about the thelist mailing list