Red Wingate wrote:
use " to display the data in the input-text element and undo this before inserting it into the database
function quoteToHtml ( $string ) { return str_replace( '"' , '"' , $string ); } function htmlToQuote ( $string ) { return str_replace( '"' , '"' , $string ); }
Only way to go :-)
You don't need to "undo" anything in the data submitted from the form. This is done automatically. Try it. It's the same as how URL values are decoded automatically.
Also, instead of str_replace, you can use htmlentities($string,ENT_QUOTES), which will convert single and double quotes (among other characters) just in case you end up using either one in your HTML.
-- ---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