Ok, I have the script set to two different email commands, but what happends is I get two emails for the second string, so basically one email to gspot@gspotracing.com that is blank and one that actually has the customers information in it. What can I do or add to this script in order to only recieve the one with the customers information and at the same time, the confirmation email script will still be sent? PLEASE HELP.....
<?php require_once('Connections/SmartHomes.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "Contact")) {
$insertSQL = sprintf("INSERT INTO Contact1 (`Contact By`, `Project Location`, `Project Type`, `Number Of Bedrooms`, `Number Of Bathrooms`, `Square Footage`, `Interested In`, `First Name`, `Last Name`, Address, City, `State`, Zip, `Email Address`, `Home Phone#`, `Personal Info Authorization`, `Alternate Phone#`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['ContactBy'], "text"),
GetSQLValueString($HTTP_POST_VARS['ProjectLocation'], "text"),
GetSQLValueString($HTTP_POST_VARS['Typeofproject'], "text"),
GetSQLValueString($HTTP_POST_VARS['Bedrooms'], "int"),
GetSQLValueString($HTTP_POST_VARS['Bathrooms'], "int"),
GetSQLValueString($HTTP_POST_VARS['Squarefootage'], "int"),
GetSQLValueString($HTTP_POST_VARS['interest'], "text"),
GetSQLValueString($HTTP_POST_VARS['FirstName'], "text"),
GetSQLValueString($HTTP_POST_VARS['LastName'], "text"),
GetSQLValueString($HTTP_POST_VARS['Address'], "text"),
GetSQLValueString($HTTP_POST_VARS['City'], "text"),
GetSQLValueString($HTTP_POST_VARS['State'], "text"),
GetSQLValueString($HTTP_POST_VARS['Zip'], "int"),
GetSQLValueString($HTTP_POST_VARS['Email'], "text"),
GetSQLValueString($HTTP_POST_VARS['HomePhone'], "int"),
GetSQLValueString($HTTP_POST_VARS['Authorization'], "text"),
GetSQLValueString($HTTP_POST_VARS['AlternatePhone'], "int"));
mysql_select_db($database_SmartHomes, $SmartHomes);
$Result1 = mysql_query($insertSQL, $SmartHomes) or die(mysql_error());
}
?>
<?php
mail($Email, "Your Request", "Thank you for submitting your request. You will be contacted within the next 24-48 hours. \r\n
\r\n\r\n\r\n
---------------------------------------------------------------------------------------------------------------------------------
You have recieved this email by submitting a contact form at: [url]http://www.nevadasmarthomes.com[/url]
---------------------------------------------------------------------------------------------------------------------------------\r\n".
"From: [email]sales@nevadasmarthomes.com[/email]\r\n".
"Reply-To: [email]sales@nevadasmarthomes.com[/email]\r\n".
"Return-Path: [email]sales@nevadasmarthomes.com[/email]\r\n");
?>
<?php
mail("sales@gspotracing.com", "Submitted Contact for [url]www.Nevadasmarthomes.com[/url]", "
-----------------------------------------------------------------------------------------------------------
The following is the clients personal information, submitted at [url]http://www.nevadasmarthomes.com:[/url]
-----------------------------------------------------------------------------------------------------------\r\n
First Name: $FirstName\r\n
LastName: $LastName\r\n
Address: $Address\r\n
City: $City, State: $State, Zip: $Zip\r\n
Email: $Email\r\n
Home Phone#: $HomePhone\r\n
Alternate Phone#: $AlternatePhone\r\n
Please Contact me by: $ContactBy\r\n
Project Location: $ProjectLocation\r\n
Project Type: $Typeofproject\r\n
My home/office has this many bedrooms: $Bedrooms\r\n
My home/office has this many Bathrooms: $Bathrooms\r\n
My home/office is approximately this many square feet: $Squarefootage\r\n
I'm interested in: $interest\r\n
Authorization of use of personal information: $Authorization\r\n");
?>