I’m new to php. Need some basic help. I have a contact form that works except I get results with slashes in front of every apostrophe. Need to know how to use stripslashes This form is using a function clean_string and I don’t know how to use stripslashes.
I’ll just address the comment section of the form and php here. Here’s the gist of my form in the html, just the comments section is what I’ll show:
and in the php file it’s handled with:
if(!isset($_POST['comments'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$comments = $_POST['comments']; // required
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Comments: ".clean_string($comments)."\n";
How do I fix? Thanks in advance.
Dave