Name
Phone
a selection from two drop down lists
a selection from radio buttons, and
comments
Here is the initial code I used, but it only returned the variable "phone" or "comments" whichever I entered.
Code: Select all
[syntax=php]<?php
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$phone = $_REQUEST['phone'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://www.c1realty.com/temp/pm/lfm.htm" );
}
elseif (empty($name) || empty($phone) || empty($email)) {
header( "Location: http://www.c1realty.com/temp/error.htm");
}
else {
mail( "info@c1realty.com", "Manager Form Results",
$phone, "From: $name <$email>" );
header( "Location: http://www.c1realty.com/temp/thanks.htm" );
}
?><?php
$to = "info@c1realty.com";
$subject = "Maintenance Request";
$message = "";
$from = trim(strip_tags($_REQUEST['email']));
foreach($_REQUEST as $key => $val)
{
$message .= $key .": ". trim(strip_tags($val)) ."\n";
}
if( !mail($to, $subject, $message, "From: $from")) {
header("Location: http://www.c1realty.com/temp/error.htm");
}
else {
header("Location: http://www.c1realty.com/temp/thanks.htm");
?>
Can someone take a look and see what I am missing or what I have done wrong. From all the posts, scripts and forums and yes tutorials I have read, I can't seem to get this to work. Thanks
Vienie
[/syntax]