Jump to content

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 = '[email protected]';
   
  $emailFrom = FilterCChars("[email protected]");
   
  $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: [email protected]\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']);
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.