Results 1 to 10 of 10

Thread: Form Processor - multiple recipients

  1. #1
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default Form Processor - multiple recipients

    from my current form processor:

    PHP Code:
    //Format Email
    $email    username@domain.com;
    $subject  "Contact Form";
    $headers  "From: $vis_email\r\n";
    $headers .= "Content-type: text/html\r\n";
    //Send Email
    mail($email,$subject,$message,$headers); 
    If I have a form which has a list menu of departments - can I program in the form processor to mail the form to a particular recipient and not all?
    Can anyone talk me through the concept of what I need to do with programming?

    Thanks in advance!
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  2. #2
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    Default

    You mean a select box? Just name it email.

    PHP Code:
    <select name=email>
    <
    option value="support@dude.com">Cool dudes</option>
    <
    option value="flimflam@stoopid.com">Morons</option>
    </
    select
    Then when you submit -

    $email=$_REQUEST['email'];

  3. #3
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    I am trying to hide the email addresses in the form page so I need to assign $email1, $email2 in the form processor....

    wouldn't I need some sort of if else statement?
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  4. #4
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    Default

    PHP Code:
    <select name=mailnum>
    <
    option value="1">Cool dudes</option>
    <
    option value="2">Morons</option>
    </
    select
    Welcome to numbered arrays
    PHP Code:
    $mail[1]='support@dude.com';
    $mail[2]='flimflam@stoopid.com';
     
    $email=$mail[$_REQUEST['mailnum']]; 

  5. #5
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    THANKS John-Marc!

    Also, do you know if I use a script like the one below - will email miners still grab the email:

    HTML Code:
    <script language=javascript>
      <!--
      var recipient = "e-mail"
      var email = "user"
      var Host = "domainname.com"
      document.write("<a href=" + "mail" + "to:" + email + "@" + Host+ ">" + recipient + "</a>" + "!")
      //-->
    </script>
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  6. #6
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    Default

    Most likely not, but that is such a well know script, why not disguise a little further? - just in case...

    PHP Code:
      var recipient "e-mail"
      
    var z1 "user";
      var 
    z2 "domainname";
      var 
    z3 "com";
      var 
    s1 "@";
      var 
    s2 ".";
      
    document.write("<a href=" "mai" "lto:" +z1+s1+z2+s2+z3 ">" recipient "</a>" "!"
    In fact, I tend to avoid 'email' as a name of a var anyway, because some bots reading the form can figure it out and start hitting the form with a POST of their own.

  7. #7
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    okay - this makes sense to me, believe it or not!

    Very helpful information as always John-Marc!
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  8. #8
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    Default

    Of course I believe it. You are a bright little girl!

  9. #9
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    Wow - little girl huh? lol
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  10. #10
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    John-Marc -

    Your advice worked perfectly, as always - thank you!
    Thank you,
    Lynne Hanson
    RL Hanson-Online

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14