View Single Post
Old 11-30-2012, 07:40 PM   PM User | #10
Junsee
New Coder

 
Join Date: Jun 2012
Posts: 42
Thanks: 4
Thanked 5 Times in 5 Posts
Junsee is an unknown quantity at this point
I think he means
PHP Code:
$_POST['body'

and I always find this handy for stripping out magic quotes
PHP Code:
    if (get_magic_quotes_gpc()) {
        
$bodystripslashes($_POST['body']);
    } else {
        
$body $_POST['body'];
    } 
and this to get rid of nasti-ness
PHP Code:
    $quotes = array('/"/',"/'/");
    
$replacements = array('"','& # 39;');
    
$body preg_replace($quotes,$replacements,$body); 
Sorry and to answer the question
in the database ignore the /r/n but whe you want to echo use this
PHP Code:
echo nl2br($body); 

Last edited by Junsee; 11-30-2012 at 07:45 PM.. Reason: answer question
Junsee is offline   Reply With Quote
Users who have thanked Junsee for this post:
sanomani (12-04-2012)