Help with Form2Mail script

Hi Everyone,

I am using the Form2Mail.php in the Form2Mail plugin for Adobe Dreamweaver.

I am wanting to send the form to a certain recipient based on what they select in the drop down menu in the form. See form drop down code below:

Person 1 Person 2 Person 3 Person 4

Is there something i can add in the Form2Mail script?

Thank you
Jordan

Well, I am not familiar with the Form2Mail plugin’s, but, the easiest way is to set the value of the SELECT
to the user’s ID in their profile page. In other words, you have a SELECT with each option point to an email
address. If your user table contains the four person’s that you show in your sample and their ID in the
user table is really 1-2-3-4, then, you can grab their email in code from the user’s table. Then, you would
need to place their email address into the TO: variable in the mail function.

So, the mail function looks sort of like: mail($to, $from, $cc, $subject, $message); or however you set it up
with variables that you fill in from the form. The option in your SELECT for person #2 is ‘2’. You would need
to pull this using a query from your user’s table and get their real email address. That becomes the $to in
the mail function.

NOTE: You never want to store the email addresses directly in the SELECT. A user could view-source and
get all of them. Always protect your user’s info!

Hope that helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service