Jump to content

post values to email


rthomson

Recommended Posts

Hi, During post of my form I am trying to send some table values.  The three field values (DATE, SITE, PRICE) that I want to send are attached to the id field (RID) in the daterange table.  The variable $FTGRID is attached to the RID field.  Here is the structure of the daterange table and the code from the php page related to the email is below.  Do I need to pre-define variables for these three field values?

 

daterange Table:

RID

DEND

MONTH

DATE

SITE

PRICE

STATUS

 

if ( $validationFailed === false ) {

# Email to Form Owner
  
$emailSubject = FilterCChars("Your Reservation");
  
$emailBody = "Reservation Date : \n"
  . "Site : \n"
  . "Price : \n"
  . "Fname : $FTGFNAME\n"
  . "Lname : $FTGLNAME\n"
  . "Addr1 : $FTGADDR1\n"
  . "Addr2 : $FTGADDR2\n"
  . "City :  $FTGCITY\n"
  . "State : $FTGSTATE\n"
  . "Zip : $FTGZIP\n"
  . "Phone : $FTGPHONE1"
  . "- $FTGPHONE2"
  . "- $FTGPHONE3\n"
  . "Email : $FTGEMAIL\n"
  . "Payment Method : $FTGPM\n"
  . "Last Four CC : $FTGC4\n"
  . "";
  $emailTo = 'u@yahoo.com';
   
  $emailFrom = FilterCChars("inquiry@c.com");
   
  $emailHeader = "From: $emailFrom\n"
   . "MIME-Version: 1.0\n"
   . "Content-type: text/plain; charset=\"UTF-8\"\n"
   . "Content-transfer-encoding: 8bit\n";
   
  mail($emailTo, $emailSubject, $emailBody, $emailHeader);
  
  
# Confirmation Email to User
  
$confEmailTo = FilterCChars($FTGEMAIL);
  
$confEmailSubject = FilterCChars("Confirmation of Reservation");
  
$confEmailBody = "Reservation Date : \n"
  . "Site : \n"
  . "Price : \n"
  . "Fname : $FTGLNAME\n"
  . "Lname : $FTGLNAME\n"
  . "Addr1 : $FTGADDR1\n"
  . "Addr2 : $FTGADDR2\n"
  . "City : $FTGCITY\n"
  . "State : $FTGSTATE\n"
  . "Zip : $FTGZIP\n"
  . "Phone : $FTGPHONE1"
  . "- $FTGPHONE2"
  . "- $FTGPHONE3\n"
  . "Email : $FTGEMAIL\n"
  . "Payment Method : $FTGPM\n"
  . "Last Four CC : $FTGC4\n"
  . "";
  
$confEmailHeader = "From: inquiry@c.com\n"
  . "MIME-Version: 1.0\n"
  . "Content-type: text/plain; charset=\"UTF-8\"\n"
  . "Content-transfer-encoding: 8bit\n";
  
mail($confEmailTo, $confEmailSubject, $confEmailBody, $confEmailHeader);

Link to comment
https://forums.phpfreaks.com/topic/237586-post-values-to-email/
Share on other sites

sure, just query the table after you've validated the post.

$getinfo = mysql_query("SELECT DATE, SITE, PRICE FROM daterange WHERE RID=$FTGRID ");
WHILE ($resultinfo = mysql_fetch_array($getinfo)){
$date = ($resultinfo['DATE']);
$site = ($resultinfo['SITE']);
$price = ($resultinfo['PRICE']);
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.