Jump to content

Archived

This topic is now archived and is closed to further replies.

mcmuney

Form no accepting html

Recommended Posts

I'm using a script to send messages to members within my site, but the form doesn't accept html. Plus, everywhere there's ' is used, on reply it adds a bunch of \\\\\'. I've narrowed this problem down to the following lines (particularly the htmlspecialchars and addslashes). Any help to explain this would be greatly appreciated:

[code]
$subject = htmlspecialchars($subject);
$body  = htmlspecialchars($body);
$sql="INSERT INTO `sc_messages` (`smg_from`, `smg_to`, `smg_subject`, `smg_body`, `smg_postdate`,`smg_block` ) VALUES ('$social_mem_id','$scm_mem_id ','$subject','".addslashes($body)."','$time','$smg_block')";

[/code]

Share this post


Link to post
Share on other sites
did you try to use stripslashes like so

[code]
$body = $_POST['body'];


$body = stripslashes($body);
[/code]

that should remove the //////
but i did notice that you are useing addslashes($body) that will add the ///////  so change addslashes to stripslashes and that should solve your problem

Share this post


Link to post
Share on other sites
Strange, if I replace "addslashes" with "stripslashes", it no longer writes to the database.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.