Re: a problem with datagarid and images

From: Date: Wed, 22 Aug 2007 17:08:44 +0000
Subject: Re: a problem with datagarid and images
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-27842@lists.php.net to get a copy of this message
On 8/22/07, Michael Tadmor <miket22@gmail.com> wrote: > Hi, > I'm using the pear-datagrid along with pg-sql. > i want to display images using the htmlTable and the toHtml() method. > on the Database i have this string "<img src=imgFileName.bmp>" stored but > when the table is displayed on the web-page i'm getting that string instead > of the html it represents (which is the picture itself). > how can I show the picture using the datagrid? > SDG escapes all output properly to make sure that random data can't break your page (XSS). I would suggest that you not store HTML in your table and instead store the filename if that is the only purpose for that column. If it just *may* store an image and you trust all of the data in there (i.e. only trusted users can insert data there) then you can get around th eescaping by using a column formatter. Use the column formatter callback and just return the value directly. -- Justin Patrin

« previous php.pear.general (#27842) next »