Jump to content

Archived

This topic is now archived and is closed to further replies.

merebel

contact form help

Recommended Posts

Need help setting up a contact form, my biggist problem is I would like a drop down box for differnt contact emails

Example would be to: support or Sales or Admin. for the fields and each one would go to a diifernt email account


Thanks
Keith

Share this post


Link to post
Share on other sites
Use the dropdown value to reference an array of email addresses in the php script. The html form will not display the email addresses.

Part of the html script is a simple dropdown:

[code]Email to:
<select name="whoto">
<option value="1">Support</option>
<option value="2">Sales</option>
<option value="3">Admin</option>
</select>[/code]

Part of the processing script
[code]<?php
$whoto = $_POST['whoto'];
$mails = array("", "support@there.com", "sales@here.com", "admin@nowhere.com");
$mailto = $mails[$whoto]; // send the mail to

... rest of the contact form processing ...
?>[/code]

Share this post


Link to post
Share on other sites

×

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.