Jump to content

Require Two Events from Form Submission


Aldark

Recommended Posts

I have a question.  I have a form that I am storing submitted referrals in MySQL; at the same time I need to email the values to my client.

 

I can do both individually, but cannot wrap my head around combining them into one action.

 

This is my insert code and I want those values passed through to email.

$sql = "INSERT INTO tbl_referral (
		fname,
		lname,
		phone,
		phonetype,
		email
		$addl_insert_crit ) valueS ( '$fname',
		'$lname',
		'$phone',
		'$phonetype',
		'$email'
		$addl_insert_values )";
if ($sql_debug_mode==1) { echo "<BR>SQL: $sql<BR>"; }
$result = mysql_query($sql,db());

 

Any thoughts or ideas would be great.

 

Thanks

Link to comment
Share on other sites

Simply add the code to send the email after the code to insert the record into the database (or vice versa).

 

//Insert into database
$sql = "INSERT INTO tbl_referral
        (fname, lname, phone, phonetype, email $addl_insert_crit)
        VALUES
        ( '$fname', '$lname', '$phone', '$phonetype', '$email' $addl_insert_values )";
if ($sql_debug_mode==1) { echo "<BR>SQL: $sql<BR>"; }
$result = mysql_query($sql,db());

//Send email

//....Code for email goes here

Link to comment
Share on other sites

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.