Try this but I don't see where you've set these variables, or did you get this code somewhere and haven't initialized it your self? For example $sender_name where is the name being set? If this is your whole code I think that'd be the problem, the one line code before could've been it...
PHP Code:
<?php
error_reporting (E_ERROR );
//---------------------------- Setting the Body of Email (message) --------------------
$message = "Name: " . $sender_name . "\n" . "Address: " . $sender_address . "\n" . "Town: " . $sender_town . "\n" . $sender_county . "\n" . "Postcode: " . $sender_postcode . "\n" . "Country: " . $sender_country . "\n" . "\n" . "Sender Email: " . $sender_mail . "\n" . "Phone: " . $tel . "\n" . "Information Requested: " . "\n" . $biohealing . "\n" . $info121 . "\n" . $sender_training . "\n" . "User wants to book: " . "\n" . $sender_book121 . "\n" . $sender_bookworkshop . "\n" . "Please register my details for: " . "\n" . $sender_mailinglist . "\n" . $sender_draw . "\n" . "The user left this message: " . "\n" . $sender_message . "\n" . "The comment submitted was: " . "\n" . $sender_comments . "\n" . "How they found this site: " . "\n" . $source . "\n" . "The magazine referal if selected was: " . $referral . "\n" . "\n";
//-------------------------------------- Set and Check Vars ---------------------------
$ipaddy = getenv(HTTP_X_FORWARDED_FOR);
if($ipaddy == 0) {
$ipaddy = $REMOTE_ADDR;}$date = gmDate("D d F y");
$from = "Message sent by " . $email . " from " . $ipaddy;$mail_to = "web@raphayad.com";
$mail_subject = "BioEnergyhealing Form";
$mail_body = $message . "\n" ."-----------------------------\n" . $from . "\n" . $date;$ipdate = "ips.txt";$whatever = 1;$con_to = $sender_mail;$con_subject = "Thank you for your request";$con_body = "This is an automated response. Your information sent from the IP: $ipaddy, was accepted and is being processed (copied below). \n" . "\n" . "Thank you for your interest.\n" . "Should your enquiry require a response we hope to come back to you within 2 working days." . "\n \nAdministration Team " . "\nBioenergy Healing Clinic\n" . "\n" . "http://www.bioenergyhealing.org.uk\n" . "\n" . "NB: This is an automated email." . "\n" . "\n" . "Name: " . $sender_name . "\n" . "Address: " . $sender_address . "\n" . "Town: " . $sender_town . "\n" . "Country: " . $sender_country . "\n" . "Postcode: " . $sender_postcode . "\n" . "Sender Email: " . $sender_mail . "\n" . "Phone: " . $tel . "\n" .
"Information Requested: " . "\n" . $biohealing . "\n" . $info121 . "\n" . $sender_training . "\n" . "User wants to book: " . "\n" . $sender_book121 . "\n" . $sender_bookworkshop . "\n" . "Please register my details for: " . "\n" . $sender_mailinglist . "\n" . $sender_draw . "\n" . "The user left this message: " . "\n" . $sender_message . "\n" . "The comment submitted was: " . "\n" . $sender_comments . "\n" . "How they found this site: " . "\n" . $source . "\n" . "The magazine referal if selected was: " . $referral . "\n" . "\n";
//------------------------------ Redo Function --------------------------------------
function redo($error){ readfile("enq_error.html");
die();
}
//------------------------------------ Send Mail Code -----------------------------
if(mail($mail_to, $mail_subject, $mail_body, "From: webdata@bioenergyhealing.org.uk\r\nReply-to: webdata@bioenergyhealing.org.uk")) {
readfile("submitted.htm");
mail($con_to, $con_subject, $con_body, "From: webdata@bioenergyhealing.org.uk\r\nReply-to: webdata@bioenergyhealing.org.uk");
}
//---------------------------- Reproduce the Previous HTML page --------------------
else { redo('Please try again');
}
?>
To be more specific at line 2 you should add in maybe 30 lines getting your values to variables and your method should have quotes method="post"... On to getting the variables.
PHP Code:
$sender_name = $_POST['sender_name'];
all others in the same format
PHP Code:
$variable_name = $_POST['input_name_in_form'];
You can put these anywhere, but line 2 would be your best place because you are using them at line 4 and they have to be declared before they can be used.
Bookmarks