Treehouse: Grow your CSS skills. Land your dream job.

Contact form – different mail functions depending on what option you choose?

  • # October 12, 2011 at 2:28 pm

    I have a client site that I am working on they have 5 locations for there business. They want a corporate site for all locations, yet a contact form with a select drop-down at the top and depending on which location is selected, the data will be emailed to the specific locations email. How does this work? I don’t think this the best usable type of form, but the client is dead set on it.

    I’m pretty sure an if statement through php that said if location1 = 1 {email here}, elseif location2 = 1 {email here}, etc? Is that right?

    I’m not the greatest with php so…

    Also I found this on another site, but it is directing to a new page:

    # October 12, 2011 at 4:13 pm

    A switch would be quicker than an if :) e.g.

    switch ($_POST) {
    case '1':
    $strEmail = '';

    case '2':
    $strEmail = '';

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.