Jump to content

How can I make my text boxes and text areas more secure ?


Guest upirate

Recommended Posts

Guest upirate

Pretty much user gets to a page where there are text boxes and text areas.

 

 

Now I understand that I can do a strip_html and possibly take out any malicious input.

 

 

What else can I do ?

 

I do want the user to be able to atleast go to next line and maybe bold the text.   

 

Problem is that when user enters data in the text area, well it doesnt remember the next lines and join all of them together.

 

 

any ideas ?

have you tried using nl2br

<?php
echo nl2br("hello\nworld");
?>

hello\nworld 

be comes

hello<br>world

 

 

basically filtering can be a pain if you want to accept some html, i nomally replace

<B> & </B>

with

[b] & [/b]

then replace back

 

so bold will work bit other html statements like will not

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.