Results 1 to 8 of 8
  1. #1
    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"> ?

  2. #2
    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?

  3. #3
    Join Date
    Apr 2002
    Location
    Philadelphia
    Posts
    2,278
    PHP Code:
    <INPUT TYPE="image" SRC="images/submit.gif" HEIGHT="" WIDTH="" BORDER="0" ALT="Submit"

  4. #4
    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?

  5. #5
    Join Date
    Jun 2001
    Posts
    1,239
    Moving to the correct forum... =)
    TradeViceroy

  6. #6
    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.

  7. #7
    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.

  8. #8
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •