spires Posted May 19, 2007 Share Posted May 19, 2007 Hi I've been uploading my textarea content into my database useing a technique that works. But, i was wondering, Is there a better way. I upload the text using; $description=addslashes(nl2br($_POST['description'])); <textarea name="description" cols="40" rows="7" wrap="PHYSICAL" id="description" value="'.$row['description'].'">'.strip_tags($description, '<b><br /><i>').'</textarea> I display the content using: $description = stripslashes($row['description']); <TABLE> <TR> <TD> <span class="pro_main_text">'.$description.'</span><br> </TD> </TR> </TABLE> Doing it this way always seems to be a problem when editing the HTML. So, Is there a better way?? Thanks Jeff Quote Link to comment https://forums.phpfreaks.com/topic/52126-whats-the-best-way-text-upload/ Share on other sites More sharing options...
neel_basu Posted May 19, 2007 Share Posted May 19, 2007 Use htmlentities() Quote Link to comment https://forums.phpfreaks.com/topic/52126-whats-the-best-way-text-upload/#findComment-257066 Share on other sites More sharing options...
spires Posted May 19, 2007 Author Share Posted May 19, 2007 Thanks Do i use it instead if nl2br? Would my code look like this: $description=addslashes(htmlentities($_POST['description'])); Quote Link to comment https://forums.phpfreaks.com/topic/52126-whats-the-best-way-text-upload/#findComment-257079 Share on other sites More sharing options...
neel_basu Posted May 19, 2007 Share Posted May 19, 2007 Did you looked at the manual on whats the job of htmlentities() ?? first see that. Quote Link to comment https://forums.phpfreaks.com/topic/52126-whats-the-best-way-text-upload/#findComment-257082 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.