Re[2]: [PHP] How to escape " in hidden field?

From: Date: Tue, 03 Sep 2002 07:13:15 +0000
Subject: Re[2]: [PHP] How to escape " in hidden field?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-114987@lists.php.net to get a copy of this message
Hi, Tuesday, September 3, 2002, 4:35:45 PM, you wrote: >> Try this with single quotes: >> >> <INPUT TYPE="HIDDEN" VALUE='Hello "world"' >> NAME="Message"> MT> Year, but then I couldn't use single-quotes in the text ;-) The problem is that MT> the content of the field is inserted by the user, so I cannot say if he uses MT> single- and/or double-quotes. How about this then... <? $test = "Hello \"O'Brian\""; ?> <INPUT TYPE="HIDDEN" VALUE="<?echo htmlentities($test)?>" NAME="Message"> No need to decode the returned value -- regards, Tom

« previous php.general (#114987) next »