Re[2]: [PHP] Problems escaping apostrophe, please help
| From: | Tom Rogers | Date: | Sat, 11 Jun 2005 00:35:46 +0000 |
| Subject: | Re[2]: [PHP] Problems escaping apostrophe, please help | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-216836@lists.php.net to get a copy of this message | ||
Hi,
TR> What I do to overcome this is in PHP do:
TR> $content = rawurlencode($content);
TR> and in the html javascript:
TR> unescape("$content");
I didn't do that very well, your code would look something like:
<li>
<a href="#"
onclick='document.form1.how.value=unescape("<?php
rawurlencode($row['how'])?>");
document.form1.factor.value=unescape("<?php
rawurlencode($row['factor']))?>");
document.form1.submit();'><?php htmlentities($row['factor'])?>
</a>
</li>
--
regards,
Tom