I used your suggested code and both sites work (thank you!) for sending…well, one does.
for this site: http://plusav.partycinemas.com/#filter=.contact
the reason I am using the same php file on both pages is my hosting company said: you can not use the PHP mail function as it does not support authenticated SMTP.
I copied the video dance php to use on the plus av contact page… after sending on the original plusav contact form php the area where you enter your details would cover over and show success or errors. …since switching to the video dance version, the form sends, but the client has no confirmation that anything has been sent as it doens’t operate like the video dance one that give a pop up window. (the content doesn’t get covered and no message is given… all the entered info just stays there even though it’s sent)
Hope this makes sense. Here is the original php code from the template that does not work on my server:
[php]<?php
if(!$_POST) exit;
function tommus_email_validate($email) { return filter_var($email, FILTER_VALIDATE_EMAIL) && preg_match(’/@.+./’, $email); }
$name = $_POST[‘name’]; $email = $_POST[‘email’]; $comments = $_POST[‘comments’];
if(trim($name) == ‘’) {
exit('<div class="error_message">Attention! You must enter your name.</div>');
} else if(trim($name) == ‘Name’) {
exit('<div class="error_message">Attention! You must enter your name.</div>');
} else if(trim($email) == ‘’) {
exit('<div class="error_message">Attention! Please enter a valid email address.</div>');
} else if(!tommus_email_validate($email)) {
exit('<div class="error_message">Attention! You have entered an invalid e-mail address.</div>');
} else if(trim($comments) == ‘Comment’) {
exit('<div class="error_message">Attention! Please enter your message.</div>');
} else if(trim($comments) == ‘’) {
exit('<div class="error_message">Attention! Please enter your message.</div>');
} if(get_magic_quotes_gpc()) { $comments = stripslashes($comments); }
$address = ‘[email protected]’;
$e_subject = 'You’ve been contacted by ’ . $name . ‘.’;
$e_body = “You have been contacted by $name from your contact form, their additional message is as follows.” . “\r\n” . “\r\n”;
$e_content = “”$comments"" . “\r\n” . “\r\n”;
$e_reply = “You can contact $name via email, $email”;
$msg = wordwrap( $e_body . $e_content . $e_reply, 70 );
$headers = “From: $email” . “\r\n”;
$headers .= “Reply-To: $email” . “\r\n”;
$headers .= “MIME-Version: 1.0” . “\r\n”;
$headers .= “Content-type: text/plain; charset=utf-8” . “\r\n”;
$headers .= “Content-Transfer-Encoding: quoted-printable” . “\r\n”;
if(mail($address, $e_subject, $msg, $headers)) { echo “
Email Sent Successfully.
Thank you $name, your message has been submitted to us.
”; }[/php]