Bug #688: HTML special characters switched to meta-ASCII in form input

From: Date: Mon, 24 Aug 1998 16:28:09 +0000
Subject: Bug #688: HTML special characters switched to meta-ASCII in form input
Groups: php.dev 
Request: Send a blank email to php-dev+get-550@lists.php.net to get a copy of this message
From: whit@transpect.com Operating system: Redhat 5.0 PHP version: 3.0.1 PHP Bug Type: MySQL related Bug description: Using Apache 1.2.6, and data retrieved from MySQL that includes HTML special characters, then inputting that data through a form back to PHP to do further searches against the database, the special characters are, on this second reception by PHP, in their meta-ASCII form rather than the string for the special character, and thus no longer correlate properly with the database. (Magic Quotes is not compiled in.) Here is a script which produces this: === <?php if (isset($choice)) { echo "Choice: $choice<br>"; echo "<xmp>Code: $choice</xmp><br>"; } ?> <form action=<?php echo $PHP_SELF; ?> method=post> <input type=radio name=choice value="Nez Perc&#233;">Nez Perc&#233; - <xmp>Nez Perc&#233;</xmp><br> <input type=radio name=choice value="Northwest-Coast">Northwest-Coast - <xmp>Northwest-Coast</xmp> <input type=radio name=choice value="Penobscot">Penobscot - <xmp>Penobscot</xmp><br> <input type=submit value=Submit></form> === My earlier report was based on the misimpression that the error occurred on PHP's initial MySQL retrieval - which is why I'm following up under the MySQL categore (that and there not being an Apache category). What I see when I run this with Nez Perce selected is that the ASCII character for e-acute shows as the returned value on submission, rather than &#233; - the same problem occurs if &eacute; is used in the data string. Since using PHP's function to turn it back into HTML special characters would produce &eacute; here, which wouldn't match &#233;, I'm looking for a solution that will keep the special characters in their original HTML form throughout. Don't know how to test if the problem occurs in Apache's reception of the form data, or PHP's reception of it from Apache. -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#550) next »