Reply to Re: open html tags

Your name:

Reply:


Posted by Neredbojias on 09/26/07 07:12

Well bust mah britches and call me cheeky, on Tue, 25 Sep 2007 11:04:57
GMT scribed:

> Ok, I'll try to focus my problem ;)
> When an user posts a message, I use php function 'strip_tags' to allow
> only some tags.
>
> strip_tags($text, '<b><i><u><br><a><q><image>')
>
> I think I could use regex to close open tags but I would like to try
> something easier. Moreover, I must check open quotes and so on.
> I would like to try something easier and faster (and probably
> worse) :)
> I think I'll have to choose the hard and long way

You'd be better off working from the other direction: change all input to
text, then html-ize only those tags you want. I just got through doing a
whole bunch of this stuff and it isn't particularly that bad. However,
regex expressions are definitely a boon to the endeavor.

--
Neredbojias
Half lies are worth twice as much as whole lies.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация