Send Email Confirmation & Post to URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nicnac23
Forum Newbie
Posts: 2
Joined: Tue Jul 13, 2010 8:58 am

Send Email Confirmation & Post to URL

Post 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
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Send Email Confirmation & Post to URL

Post 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;
}
nicnac23
Forum Newbie
Posts: 2
Joined: Tue Jul 13, 2010 8:58 am

Re: Send Email Confirmation & Post to URL

Post 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
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Send Email Confirmation & Post to URL

Post by Jade »

Yes
Post Reply