Hi Everyone :}
I am a complete PHP newbie and I am trying to follow the tutorial here on how to set up a comment form.
I have put together the following PHP for the mailer.php:
<?php
if(isset($_POST[‘submit’])) {
$to = “lesley@aliarts.co.nz”;
$subject = “Form Submission from BusinessCardBiz”;
$name = $_POST[‘name’];
$qualifications = $_POST[‘qualifications’];
$position = $_POST[‘position’];
$physicaladdress = $_POST[‘physicaladdress’];
$postaladdress = $_POST[‘postaladdress’];
$city = $_POST[‘city’];
$state = $_POST[‘state’];
$zip = $_POST[‘zip’];
$phone = $_POST[‘phone’];
$fax = $_POST[‘fax’];
$email = $_POST[‘email’];
$website = $_POST[‘website’];
$tagline = $_POST[‘tagline’];
$dropdown = $_POST[‘drop_down’];
$backcontent = $_POST[‘backcontent’];
$anythingelse = $_POST[‘anythingelse’];
}
$body = “From: $name
Qualifications: $qualifications
Physical Address: $physicaladdress
Postal Address: $postaladdress
City: $city
State: $state
Zip: $zip
Phone: $phone
Fax: $fax
email: $email
Website: $website
Tagline: $tagline
$check_msg Option: $option
Drop-Down: $dropdown
Back Content:
$backcontent Anything Else:
$anythingelse”;
header( “Location: http://www.businesscardbiz.com/thankyou.html” )
echo “Data has been submitted to $to!”;
mail($to, $subject, $body);
} else {
echo “blarg!”;
}
?>
It could be a complete mess, but I am really not sure as I just tried to follow the tutorial and hope for the best!
When I take:
echo “Data has been submitted to $to!”;
mail($to, $subject, $body);
} else {
echo “blarg!”;
}
out, I get redirected to the page that I want to be, but no email. If I leave it on, I get this error:
Parse error: parse error, unexpected T_ECHO in /mnt/w0400/d45/s03/b0296bf0/www/businesscardbiz.com/mailer.php on line **30
**I got the redirect from another tutorial as I couldn’t find here how to make it do this.
Please could someone look over my code and tell me what I need to fix, I will be eternally grateful.
Thanks so much in advance
Lesley