Conditional subject in PHP mail form

Discussion in 'HTML & Website Design' started by warehouselarry, Jan 8, 2008.

  1. #1
    Hopefully one of you geniuses can help me on this. I have a php file to process input from an html form and send it to an email address...that's simple enough and works fine. BUT I wouldl like the subject to change according to the submitter's response to a question in the form. Basically something like:

    If the submitter chooses "yes" then the subject would read: Newsletter
    If the submitter chooses "no" then the subject would read: Request for Info

    I know it's probably some simple PHP if/else/if thing, but I'm no PHP wiz.

    Any help is greatly appreciated!
     
    warehouselarry, Jan 8, 2008 IP
  2. Sepehr

    Sepehr Peon

    Messages:
    568
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you should use something like this
    option is the name of the html input!
     
    Sepehr, Jan 8, 2008 IP