Re: HTMLSpecialchars
| From: | David Robley | Date: | Thu, 19 Apr 2001 05:11:37 +0000 |
| Subject: | Re: HTMLSpecialchars | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49321@lists.php.net to get a copy of this message | ||
On Thu, 19 Apr 2001 14:36, ddogbruce@home.com wrote:
> I'm having a problem with HTMLspecialchars and nl2br interfearing with
> each other. Obviously, I'm trying to stop malicous HTML/scripts from
> being entered into my guestbook, but I'm also trying to add spacing.
> nl2br adds <br>, but HTMLspecialchars tells it to not show that.
>
> Anyways, I'm sure there is a way around this. All help is welcome, so
> I'm eager for replys. Thank you very, very much!
>
> -Owen
Perhaps if you do the nl2br after rather than before htmlspecialchars? Or
just use nl2br when you actually display the text, rather than trying to
put the <BR> in your database.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA