Reply to htmlentities & text to HTML

Your name:

Reply:


Posted by Nick Lazar on 03/21/06 15:19

Hi there,

I'm trying to set up a text to HTML filter on a form, for adding content to
a web page (of course).

I'm using htmlentities, but want to allow some HTML tags to be allowed in
the text, (<p>,<a>,<img> etc). I have tried including strip_tags with a list
of acceptable tags, but this doesn't seem to work well with htmlentities.

The code below gives an indication of what I am trying to do, and I know
there is a better way to do it! Any help would be gratefully accepted!

$paragraph = ($_POST['paragraph']);
$paragraph = nl2br(htmlentities($paragraph));
$paragraph = rtrim($paragraph);
$paragraph = ltrim($paragraph);

Regards,

Nick Lazar

[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

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