Re: escaping quotes

From: Date: Thu, 27 Jan 2005 12:32:34 +0000
Subject: Re: escaping quotes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-207476@lists.php.net to get a copy of this message
Giles wrote:
Hi Guys Really simple question. How do I change the following: print("value='" . $attributes["messageSubject"] . "'"); to have double quotes around the subject field instead. i.e.: print("value="" . $attributes["messageSubject"] . """);
print("value="\" . $attributes["messageSubject"] . "\""); print("value=\"{$attributes['messageSubject']}\""); Although, to prevent any vulnerabilities, you probably want: print("value="\" . htmlentities($attributes["messageSubject"]) . "\""); if you're not already doing so at some point. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#207476) next »