using htmlentities with data in textarea
| From: | Hull, Douglas D | Date: | Tue, 13 Jul 2004 15:32:19 +0000 |
| Subject: | using htmlentities with data in textarea | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-190359@lists.php.net to get a copy of this message | ||
As John H told me (which is true) I should run my words through htmlentities. I have a textarea in
a form for individuals to type in a list of words. From there I place these words in an array and
then perform calculations and echo the words back out with the resulting calculations. But if one
enters: w' my word ends up w\' I have tried using htmlentities in my array and
other places (to take the slash out) but to no avail. Here is what I tried when putting my words in
my array:
$zchrpos = 0;
$tok = strtok($zwords, " \r");
while ($tok !== FALSE) {
$toks[] =
htmlentities(trim($tok));
$tok = strtok(" \r");
$zchrpos++;
}
Any help would be appreciated,
Doug
Sorry about the return receipt turned on in previous emails!