Re: HTML tags in MySQL

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

 



You can use something like html_tidy to make the code sane, and strip_tags() 
to remove tags you don't want him using for whatever reason.  As for changing 
<b> to <i> because the style guide changed, well, you're on your own there 
without some really trippy regexing that is well beyond my capabilities. :-)

Whether you go through the database and fix it or fix on the fly on display is 
up to you.  There are pros and cons to both methods.

On Friday 22 June 2007, tedd wrote:
> Hi gang:
>
> I have a client who over the years thought it was great to enter html
> tags directly into his database via his CMS for display in his web
> site.
>
> Now, he has a mess with some data being shown one way, when he wants
> it shown another. Plus, not all the tags are well formed and some are
> even malformed (i.e., <b ).
>
> So, what to do is the question?
>
> Is there an easy way to scrub the data to remove tags; or is this
> going to be one of those "change it where you see it" in the CMS; or
> do I just scrub the data after I extract it from the dB and before
> displaying it and forget about fixing the dB?
>
> Recommendations and suggestions welcomed.
>
> Cheers,
>
> tedd
>
>
> --
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com


-- 
Larry Garfield			AIM: LOLG42
larry@xxxxxxxxxxxxxxxx		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
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