Page 1 of 1

Send Email Confirmation & Post to URL

Posted: Tue Jul 13, 2010 9:07 am
by nicnac23
Hi I am totally new to this forum, but have a question that I need help on, and I hope someone can point me in the right direction.

I am currently using PHP mail to send an email confirmation once a form is completed and submitted, however is it possible to also send this same form data to a url.

The url is already set up to handle the data, I just need the form once submitted to send the captured data to the URL as well as trigger the email confirmation.

Is this possible??

Thanks

Re: Send Email Confirmation & Post to URL

Posted: Tue Jul 13, 2010 9:22 am
by Jade
Sure it is.

Code: Select all

<?php

if ($_POST['submit']) //they submitted the form
{
        //generate and send the email

       header("Location: yournewurl.com?field1=" . $_POST['field1'] . "&field2=" . $_POST['field2'] . "&field3=" . $_POST['field3']);
       exit;
}

Re: Send Email Confirmation & Post to URL

Posted: Wed Jul 14, 2010 5:41 am
by nicnac23
Hi thanks for the reply, just to clarify, where you say

//generate and send the email

I have just to use the code I have at the moment to send the email?

Then after this is where the new code will go.

Thanks

Re: Send Email Confirmation & Post to URL

Posted: Tue Jul 20, 2010 10:58 am
by Jade
Yes