Textarea + Line Breaks + Security

Soldato
Joined
27 Dec 2005
Posts
17,315
Location
Bristol
As title, what's the best way of securing and validating textarea inputs going directly into a database whilst allowing line breaks?

I'm using mysql_real_escape_string() at the moment which retains the line breaks in the database (as viewable from phpMyAdmin), but on output onto the site again they're lost. I'm using stripslashes() on output so not sure if this is what's stripping out the line breaks too - if so, what's then the best way of... well, stripping the slashes whilst retaining breaks?
 
Cheers Rob.

PHP:
include('../includes/wpautop.php');
$description = mysql_real_escape_string(wpautop($_POST['description']));

Will that do the job then? Do I even need mysql_real_escape_string() with that?
 
Back
Top Bottom