Re: escaping quotes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux