note 70211 added to function.mail
| From: | mcabarus at gmail dot com | Date: | Fri, 06 Oct 2006 21:34:36 +0000 |
| Subject: | note 70211 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118156@lists.php.net to get a copy of this message | ||
I'm not really good at explaining my problem:
I've made a form with many fields, unfortunatley, I don't know how to put the information
from each field into an email and than submitted to me, please help or refer me to someone.
The best thing to do is just look at my php, thanks
The Form:
http://www.mikesgazette.com/aec/contact.html
The PHP:
http://www.mikesgazette.com/aec/sent.php
<?php
$fileLocation = $HTTP_SERVER_VARS["PHP_SELF"];
$fileName = basename ($fileLocation);
$notcomplete = false;
$nodata = false;
$mailto = "info@acceleratedescrow.com";
if ( !isset($_POST["subject"]) ){
$nodata = true;
}
if ( !isset($_POST["email"]) ){
$nodata = true;
}
if ( !isset($_POST["name"]) ){
$nodata = true;
}
if ( !isset($_POST["message"]) ){
$nodata = true;
}
if ( !isset($_POST["address"]) ){
$nodata = true;
}
if ( !isset($_POST["city"]) ){
$nodata = true;
}
if ( !isset($_POST["zip"]) ){
$nodata = true;
}
if ( !isset($_POST["phone"]) ){
$nodata = true;
}
if ( trim($_POST["subject"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["email"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["name"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["message"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["address"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["city"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["zip"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["phone"] == "") ){
$notcomplete = true;
}
if ($notcomplete){
echo "missing required parameter";
//you could change the a
exit ('a href="javascript:history.back(1)"> click here a');
}
$email = $_POST["email"];
$subject = $_POST["subject"];
$message = $_POST["message"];
$address = $_POST["address"];
$city = $_POST["city"];
$zip = $_POST["zip"];
$phone = $_POST["phone"];
$name = $_POST["name"];
//$mailto = "$mailto";
//$subject = "$subject";
$msg = ereg_replace("\\\'", "'", $message, $address);
$msg1 = ereg_replace('\\\"', "\"", $msg);
$message1 = "From: $name\nemail: $email\nmessage:\n$msg1;
$sent = mail($mailto, $subject, $msg, "From: $email\r\nReply-to: $email\r\n");
?>
----
Server IP: 66.163.161.117
Probable Submitter: 76.2.128.111
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/70211
Del: integrated -- https://master.php.net/note/delete/70211/integrated
Del: useless -- https://master.php.net/note/delete/70211/useless
Del: bad code -- https://master.php.net/note/delete/70211/bad+code
Del: spam -- https://master.php.net/note/delete/70211/spam
Del: non-english -- https://master.php.net/note/delete/70211/non-english
Del: in docs -- https://master.php.net/note/delete/70211/in+docs
Del: other reasons-- https://master.php.net/note/delete/70211
Reject -- https://master.php.net/note/reject/70211
Search -- https://master.php.net/manage/user-notes.php