> -----Original Message----- > From: James Arthur [mailto:[EMAIL PROTECTED]] > Sent: 07 January 2002 21:41 <snip> > For example, consider the string $body = "I am saying \"Hello\""; > > <input type="hidden" name="body" value="<?=$body>"> > is interpreted by the browser as > <input type="hidden" name="body" value="I am saying "Hello""> > And so we have a problem. > > What can I do about that?
Since this is generating HTML, you need to encode these characters as HTML entities -- consider using the htmlspecialchars() function (see http://www.php.net/manual/en/function.htmlspecialchars.php) or htmlentities() (see http://www.php.net/manual/en/function.htmlentities.php). Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]