Controlling flow of data to external recipients

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Wed Jul 11, 2012 2:40 pm

Controlling flow of data to external recipients

Postby JEH » Wed Jul 11, 2012 2:51 pm

I have a test site, On that site, there is an opt-in form (lines 120 to 138). When the user clicks "Sign me up," a JavaScript function is initiated, which validates the fields (lines 23 to 39), then sends the data to an external web site (lines 40 and 41). I intend to add an additional comments field to the form, which will be unlimited-length text, so there will be three fields, name, email, and comments.

Before I link to the external site, I want to send an e-mail containing the form fields to, let's say, I don't want to use mailto: because I don't want to confuse the user by having a mail window appear, so unless I've overlooked something, I need to use PHP mail. I have tested this and it works for me but I don't know how to get the field values to PHP.

I can create a form that sends data to PHP, but when the user submits the form, the validation and the link to the external site are bypassed.

Here is what I want to do when the user clicks "Sign me up":

1. Validate the fields (the same as lines 23 to 39 are doing now).

2. Send the field values via PHP mail.

3. Submit the field contents to the external site (the same as lines 40 and 41 are doing now).

Any suggestions?

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest