Hello I am setting up a contact page on my site and I was wondering how do I create a form where a user chooses whom theyd want to contact from a drop down list...they type their email adress ...and depending on wich drop down they selected their e-mail will be sent to a different address...i have the form there its just not working... also I have an image for the submit button how do i integrate that with <input type="submit" value="Send"> ?
Thanks well when I click on submit it opens an e-mail instead of just directly mailing it from the page. I have <form action="MAILTO:[email protected]" method="post" enctype="text/plain"> at the top of the page, is this correct?
Well it is OK - but it is not the best way to do it. This relies on your user to have their e-mail program send you the information. Also when you use this - it creates a warning message which might frighten off some users. And it is not the most reliable way.
To create a enquiry form for sending mails by selecting address from drop down menu l.... here is the example provided.
<option value="">select a dept</option>
<option value="3">human resources</option>
You can access this in the script that the form posts to by accessing the $_POST superglobal array. First test to make sure a selection was made.
if ($_POST['email'] == "" ¦¦!isset($_POST['email']))
echo "you didn't pick any dept";
case 1: $mail_to = "[email protected]";
case 2: $mail_to = "[email protected]";
case 3: $mail_to = "[email protected]"; break;
// then you can do your mail call here
$sub = "some subject";
$mess = "Message stuff";
$mailhead = "your preferred mail headers here";
}If you want the user to enter his email address, subject, message, mailhead then design in HTML and get the parameters in your PHP file, give in mail command. Hope you got enough information regarding enquiry form. For more details please have a look into