Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2006

    Lightbulb PHP Contact Form

    Hi Guys

    Does anyone know how to make a php contact form that includes:

    Drop down list of departments and depending on which one is chosen depends on which email its sent to, EG:

    I choose sales from dropdown it sends to [email protected]
    I choose support from dropdown it sends to [email protected]

    Also i would like it to include:

    First Name
    Last Name
    Email Address
    Existing customer: Yes or No Dropdown
    Select department (with reference to above about multiple email addresses etc)
    Message Box
    Image Verification
    Logs IP

    I know this is alot to ask but if anyone could help or make me one or point me to some helpful tutorials it would be much appreciated

    Best Regards,

  2. #2
    Join Date
    Aug 2006
    Regina, Saskatchewan, CA

    You'd want to do is establish the To: address as a variable (such as $sendee) that you can assign a value to it from your dropdown menu options. Once you have that dropdown menu variable established, carry it over to the processing script with the rest of the form field values.

    For the script itself, you could use something like .. If you use this script, you could take what they give you for the $recipient line in the formmail.php and change it from:

    $recipient = "[email protected]";
    .. to ..
    $recipient = "$sendee";

    Then establish the variable assigned to the dropdown menu items as $sendee. Once you choose one, that value would be carried over to the formmail.php file. You'll need to do a bit of haxoring to make it work but it's doable.

    I can't vouch for all related security issues involved with using this script. It was just an example of one that you could use. :-)
    Bill - Support Analyst - Liveblock Auctions International

  3. #3
    Join Date
    Nov 2006
    Oregon, USA
    Yep, I was pretty much going to echo what Bill said. It should be fairly easy to use just about any php form mail script (I personally prefer phpmailer, and just adjust the recipient email address based on the contents of the dropdown in the form.

    So for example using your emails from below, in the handler for the form you'd do something like:
    if ($_POST[department] == "sales")
       $recipient = "[email protected]";
    else if ($_POST[department] == "support")
      $recipient = "[email protected]";
      $recipient = "[email protected]";
    and then use $recipient to set the value for who the email goes to.

  4. #4
    Join Date
    May 2004
    Pflugerville, TX
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  5. #5
    Join Date
    Jun 2006
    One I made some time ago. Simple and does the trick - only 1 file and easy to edit

  6. #6
    Join Date
    Nov 2003
    Newport Beach, CA
    I agree with the_pm
    Show your reciprocal links on your website. eReferrer

Posting Permissions

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