Jump to content

Form no accepting html


mcmuney

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]
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.