cyndie
08-24-2007, 04:33 PM
I have forms on a website that I want my php to return information in the email.
Here is the php:
<?php
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$phone = $_REQUEST['phone'] ;
$date = $_REQUEST['date'] ;
$comments = $_REQUEST['comments'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://www.c1realty.com/temp/pm/mreq.htm" );
}
elseif (empty($name) || empty($phone) || empty($date) || empty($email)) {
header( "Location: http://www.c1realty.com/temp/error.htm");
}
else {
mail( "info@c1realty.com", "Web Maintenance Request Form",
$comments, "From: $name <$email>" );
header( "Location: http://www.c1realty.com/temp/thanks.htm" );
}
?>
When the email is sent to the mailbox of info@c1realty.com I want it to also include the comments, phone number, date so this information is supplied in the email.
I can get it to work using $comments, or $phone, or $date, but I cannot get it to work if I combine them for instance
$comments, $phone, $date, "From: $name <$email>" );
I know there must be a way to do this, but I have not been able to figure it out. Can someone help?
Thanks
cyndie
Here is the php:
<?php
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$phone = $_REQUEST['phone'] ;
$date = $_REQUEST['date'] ;
$comments = $_REQUEST['comments'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://www.c1realty.com/temp/pm/mreq.htm" );
}
elseif (empty($name) || empty($phone) || empty($date) || empty($email)) {
header( "Location: http://www.c1realty.com/temp/error.htm");
}
else {
mail( "info@c1realty.com", "Web Maintenance Request Form",
$comments, "From: $name <$email>" );
header( "Location: http://www.c1realty.com/temp/thanks.htm" );
}
?>
When the email is sent to the mailbox of info@c1realty.com I want it to also include the comments, phone number, date so this information is supplied in the email.
I can get it to work using $comments, or $phone, or $date, but I cannot get it to work if I combine them for instance
$comments, $phone, $date, "From: $name <$email>" );
I know there must be a way to do this, but I have not been able to figure it out. Can someone help?
Thanks
cyndie