When I upload this site's folder to my own testing site it works fine, however when I upload to the client's site the email doesn't get sent. The form appears to work and brings me to the thank you page but no email is sent.
this is the php:
<?php
$webmaster_email = "sarahtrafford@me.com";
$feedback_page = "feedback_form.html";
$error_page = "error_message.html";
$thankyou_page = "thank_you.html";
$email_address = $_REQUEST['email_address'] ;
$comments = $_REQUEST['comments'] ;
function isInjected($str) {
$injections = array('(\n+)',
'(\r+)',
'(\t+)',
'(%0A+)',
'(%0D+)',
'(%08+)',
'(%09+)'
);
$inject = join('|', $injections);
$inject = "/$inject/i";
if(preg_match($inject,$str)) {
return true;
}
else {
return false;
}
}
// If the user tries to access this script directly, redirect them to the feedback form,
if (!isset($_REQUEST['email_address'])) {
header( "Location: $feedback_page" );
}
// If the form fields are empty, redirect to the error page.
elseif (empty($email_address) || empty($comments)) {
header( "Location: $error_page" );
}
// If email injection is detected, redirect to the error page.
elseif ( isInjected($email_address) ) {
header( "Location: $error_page" );
}
// If we passed all previous tests, send the email then redirect to the thank you page.
else {
mail( "$webmaster_email", "Feedback Form Results",
$comments, "From: $email_address" );
header( "Location: $thankyou_page" );
}
?>
this is the form code in the html
<form action="send_mail.php" method="post" id="drop_form">
<label for="email">E-mail<span>*</span></label><br>
<input type="text" name="email_address" value="" maxlength="90" /><br>
<label for="message_box">Message<span>*</span></label><br>
<textarea rows="7" cols="37" name="comments" id="message_box"></textarea>
<div id="submit_form">
<input type="submit" value="Submit" class="form_btn"/>
</div>
</form>
Is there something I may need to do in their server? I uploaded it the same way in my own and it worked fine there.