Results 1 to 8 of 8
Thread: creating an inquiry form
-
03-13-2004, 09:04 PM #1Junior Guru
- Join Date
- Feb 2004
- Location
- NYC
- Posts
- 204
creating an inquiry form
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"> ?
-
03-13-2004, 09:50 PM #2Texan at Heart
- Join Date
- Jul 2003
- Location
- Castle Pines, CO
- Posts
- 7,189
This message might be better off in the programming forum, but in the meantime, what language / form handler does your web server support?
-
03-13-2004, 10:14 PM #3Web Hosting Master
- Join Date
- Apr 2002
- Location
- Philadelphia
- Posts
- 2,278
PHP Code:<INPUT TYPE="image" SRC="images/submit.gif" HEIGHT="" WIDTH="" BORDER="0" ALT="Submit">
-
03-14-2004, 01:41 AM #4Junior Guru
- Join Date
- Feb 2004
- Location
- NYC
- Posts
- 204
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:cmont81@yahoo.com" method="post" enctype="text/plain"> at the top of the page, is this correct?
-
03-14-2004, 04:45 AM #5Web Hosting Master
- Join Date
- Jun 2001
- Posts
- 1,239
Moving to the correct forum... =)
TradeViceroy
-
03-14-2004, 10:18 AM #6Texan at Heart
- Join Date
- Jul 2003
- Location
- Castle Pines, CO
- Posts
- 7,189
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.
-
03-14-2004, 10:00 PM #7Disabled
- Join Date
- Mar 2004
- Location
- Granville OH
- Posts
- 108
Hi-
does your host provide you with a cgi email program such as form mail or the ability to use php/perl/python/java?
If you don't have either then the way you're doing it now is the best you can do.
-
03-15-2004, 10:16 AM #8Web Hosting Master
- Join Date
- Feb 2004
- Posts
- 772
Hi
To create a enquiry form for sending mails by selecting address from drop down menu l.... here is the example provided.
HTML FILE
<select name="email">
<option value="">select a dept</option>
<option value="1">sales</option>
<option value="2">marketing</option>
<option value="3">human resources</option>
</select>
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.
PHP FILE
if ($_POST['email'] == "" ¦¦!isset($_POST['email']))
{
echo "you didn't pick any dept";
}
else
{
switch ($_POST['email'])
{
case 1: $mail_to = "sales@example.com";
break;
case 2: $mail_to = "marketing@example.com";
break;
case 3: $mail_to = "hr@example.com"; break;
}
// then you can do your mail call here
$sub = "some subject";
$mess = "Message stuff";
$mailhead = "your preferred mail headers here";
mail($mail_to,$sub,$mess,$mailhead);
}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
http://codewalkers.com/tutorialpdfs/tutorial10.pdf
http://www.fsix.net/files/mail_forms...l_and_php.html
To include image in your submit button, give
<INPUT TYPE="image" SRC="<image file location>" HEIGHT="" WIDTH="" BORDER="0" VALUE="Submit">
Regards,
Bright