|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-09-19 00:56 UTC] jaakko
[2025-02-05 07:51 UTC] git@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 15:00:01 2025 UTC |
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é">Nez Percé - <xmp>Nez Percé</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 é - the same problem occurs if é is used in the data string. Since using PHP's function to turn it back into HTML special characters would produce é here, which wouldn't match é, 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.