Dreamweaver generated this code as an Insert for a mysql database. My question is: can I insert a mail() function inside this code to generate an acknowledgment email to the email address entered into the form simultaneously (or, can i reuse the emailAddress variable in this code?)
if ((isset($_POST[“MM_insert”])) && ($_POST[“MM_insert”] == “form1”)) {
$insertSQL = sprintf(“INSERT INTO testID (firstName, lastName, emailAddress, phone, date
) VALUES (%s, %s, %s, %s, now())”,
GetSQLValueString($_POST[‘firstName’], “text”),
GetSQLValueString($_POST[‘lastName’], “text”),
GetSQLValueString($_POST[‘emailAddress’], “text”),
GetSQLValueString($_POST[‘phone’], “text”),
GetSQLValueString($_POST[‘date’], “date”));
mysql_select_db($database_iPage, $iPage);
$Result1 = mysql_query($insertSQL, $iPage) or die(mysql_error());
}