Re: htmlspecialchars

From: Date: Wed, 15 Jan 2003 00:45:18 +0000
Subject: Re: htmlspecialchars
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-131632@lists.php.net to get a copy of this message
on 15/01/03 4:24 AM, Foong (chiew325@tm.net.my) wrote: > Hi, > I wonder which is the better way to store data into database? > 1. stor the data after we call htmlspecialchars with the data (means we > store " as &quote; in database) > 2. stor the data in non encoded form and call htmlspecialchars whenever we > want to display it. I'm a firm believer in option 2...store it 'as-is' and adapt it to suit different environments (HTML, XML, CSV, Email, Wap, whatever)... however, if, forexample, it was a long article that gets read 1000's of times a day, and is unlikely ever to be ported into an email, or to other formats, then it makes perfect sense to get the content right once, and never worry about it again... Justin

« previous php.general (#131632) next »