Hi
I was wondering if you could help me with this small problem, I have this script that works very well but it does include the \ back slash when someone types an apostrophy. Is there a way of removing this back slash so it just shows the apostrophy in the form output?
Thank you in advance,
Phil
Here is the script-
if (isset($_POST['submit'])) { // Handle the form.
$message = NULL; // Create an empty new variable.
// Check for a name.
if (strlen($_POST['name']) > 0) {
$name = TRUE;
} else {
$name = FALSE;
$message .= '<p>You forgot to enter your name!</p>';
}
// Check for an email address.
if (strlen($_POST['email']) > 0) {
$email = TRUE;
} else {
$email = FALSE;
$message .= '<p>You forgot to enter your email address!</p>';
}
// Check for a telephone.
if (strlen($_POST['telephone']) > 0) {
$telephone = TRUE;
} else {
$telephone = FALSE;
$message .= '<p>You forgot to enter your telephone number!</p>';
}
// Check for comments.
if (strlen($_POST['comments']) > 0) {
$comments = TRUE;
} else {
$comments = FALSE;
$message .= '<p>You forgot to enter your message!</p>';
}
if ($name && $email && telephone && comments ) { // If everything's okay.
// Register the user.
// Send an email.
$to = $_POST['email'];
$message = "Thank you for your enquiry! Here is a copy of what you have submitted, we will contact you shortly.\n\nPlease do not reply to this email.\n\nYour name is '{$_POST['name']}'\n\nYour email is '{$_POST['email']}'\n\nYour telephone number is'{$_POST['telephone']}'\n\nYour comments were'{$_POST['comments']}'\n\nSincerely,\nThe Team";
$subject = 'Your Enquiry'; // Create an empty new variable.
$headers .= 'From: me@mysite.com' . "\r\n";
$headers .= 'Bcc: form@mysite' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
header ('Location: thank_you.php');
exit();
} else {
$message .= '<p>Please try again.</p>';
}
}
// Print the error message if there is one.
if (isset($message)) {
echo '<font color="red">', $message, '</font>';
}