View Single Post
Old 02-25-2010, 02:47 AM  
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by Jakez View Post
Here we go
json_encode(nl2br(str_replace("'","& #39;",$_POST['text_dump'])))

I just wanted to be able to send an FLV dump of text via ajax and I had to go through all this crap lol.
You shouldn't have to worry about that - that's an horrendous way to 'escape' text.
Your server doesn't have magic_quote or some abomination on does it ?

If you're looking to secure text for a database insert, mysql_real_escape_string()
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote