I’m kinda at my wits end. I’ll admit, I’m not an expert at PHP. However, I manage 2 other websites with this exact form (I just changed the email, and website) and it seems to work fine. I put it in a new website and the form emails, but it emails blank . The email will come through with the correct subject line but the body of the email has absolutely nothing at all. I’ve tried both a gmail email and a godaddy email with the same result (my desired email is the godaddy one). Any help you can give me on why this is happening would be much appreciated - getting this form to work is the last step in us offering online payment!!
The form:
[code]
Membership: One Year Membership with APVCS Legal Name: Name that appears on Facebook (leave blank if the same): Spouse's Name (to be included in membership): Spouse's Facebook Name (leave blank if the same): Child(ren)'s First Names: Preferred Email: Full Mailing Address, including City and Postal: How did you hear about us? Please select your payment method: Paypal (you do not need a pp account to pay by credit card with them)
Name Or Company associated with your PP account if applicable
Email Money Transfer (to [email protected])
Name and email EMT will come from
Password answer for EMT
I understand how membership works, and the expiration period (required for membership)
Questions/Comments:
The PHP:
[code][php]<?php
function filter($input){
$to_remove = array('~','`','{','}','^','[',']','<script>','</script>','<applet>','</applet>');
$clean = trim(str_replace($to_remove, "-", $input));
return $clean;
}
function cleanup_text_for_display($txt){
$txt = str_replace('_',' ',$txt);
$txt = ucwords($txt);
//$txt = str_replace(' ',' ',$txt);
return $txt;
}
if(isset($_POST) && !empty($_POST)){
$mail_content = "MEMBERSHIP FORM\r\n";
$mail_content .= "-------------------------------\r\n";
date_default_timezone_set('MST');
$mail_content .= date('F j, Y, g:i a')."\r\n";
$html_content = '<h2>Thank you for becoming a member!</h2>';
$html_content .= '<p>If there are any errors in the information below <a href="mailto:[email protected]">please let us know</a>.</p>';
foreach($_POST as $key => $value){
if(is_array($value)){
$mail_content .= cleanup_text_for_display($key).': ';
foreach($value as $item){
$mail_content .= $item." ";
}
$mail_content .= "\r\n";
}else{
if($key == 'submit_button')
continue;
// build email content
$mail_content .= cleanup_text_for_display($key).': '.$value."\r\n";
// layout form data for display in web page
$html_content .= '<p>'.cleanup_text_for_display($key).': '.$value.'</p>';
}
}
}
//,"From:[email protected]\r\nReply-to:[email protected]"
if(!mail(
//'[email protected]',
'[email protected]',
'Membership Form',
$mail_content
)){
$html_content = '<h3>ERROR: Sorry, this message could not be sent.</h3>';
$html_content .= 'Please try resubmitting the form.<br /><a href="http://www.apvillage.ca/index.html"><< BACK </a>';
$html_content .= '<br /><br />If this problem persists, please <a href="mailto:[email protected]">let us know</a>. Thanks.';
}
else {
header("location:http://www.apvillage.ca/form_response.htm");
}
?>
AP Village | Calgary <div class="content">
<?php
echo $html_content;
?>
</div>
</div>
<div>
<div id="footer">
<a href="http://www.apvillage.ca/terms.html">Terms & Conditions</a> • <a href="mailto:[email protected]">Contact Us</a>
</div>
[/php][/code]