Passing values to PHP script via check boxes.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kitesurfer
    New Member
    • Jun 2007
    • 1

    Passing values to PHP script via check boxes.

    Looking for some help with an email form using php.

    I am using check boxes in a html form, the values of check boxes are email addresses.
    The person visiting our site has the ability to select one or more check boxes.
    The values (email addresses) need to be passed on to the php script which in return sends mails to each of the selected emails. (selected addresses only)
    The script should also send an email to myself!

    Your help.... would be much appreciated, I am an absolute PHP beginner!!

    Kia Ora from NZ
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    Originally posted by kitesurfer
    Looking for some help with an email form using php.

    I am using check boxes in a html form, the values of check boxes are email addresses.
    The person visiting our site has the ability to select one or more check boxes.
    The values (email addresses) need to be passed on to the php script which in return sends mails to each of the selected emails. (selected addresses only)
    The script should also send an email to myself!

    Your help.... would be much appreciated, I am an absolute PHP beginner!!

    Kia Ora from NZ
    Hi Kia Ora,
    Welcome to TSDN!

    Please submit the HTML form and php mail script(if any).

    Comment

    • Motoma
      Recognized Expert Specialist
      • Jan 2007
      • 3236

      #3
      Have you taken a look at the mail() function? Have you written any code to try this?

      Please post what you have already (even if it isn't much) and we will do our best to give you guidance.

      Comment

      • nathj
        Recognized Expert Contributor
        • May 2007
        • 937

        #4
        My first thought, based on limited information is that you can set the value of the check box so that when it is clicked the value you read out is the email address you are after.
        For example
        [HTML]<input type="checkbox" name="email1" value="email1@d omain.com" checked> email1@domain.c om[/HTML]

        This can then be read using php in the form destination (as stated uder action="":
        [PHP]
        $_REQUEST['email1']
        [/PHP]

        Based on the info you gave I think this might help you out. If not post some code or let us know how you resolved the problem

        Nathan

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          Changed thread title to better describe the problem.

          Comment

          Working...