merebel Posted September 17, 2006 Share Posted September 17, 2006 Need help setting up a contact form, my biggist problem is I would like a drop down box for differnt contact emailsExample would be to: support or Sales or Admin. for the fields and each one would go to a diifernt email accountThanksKeith Link to comment https://forums.phpfreaks.com/topic/21034-contact-form-help/ Share on other sites More sharing options...
AndyB Posted September 17, 2006 Share Posted September 17, 2006 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("", "[email protected]", "[email protected]", "[email protected]");$mailto = $mails[$whoto]; // send the mail to... rest of the contact form processing ...?>[/code] Link to comment https://forums.phpfreaks.com/topic/21034-contact-form-help/#findComment-93381 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.