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 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() 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'])); 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. 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
Archived
This topic is now archived and is closed to further replies.