Jump to content

Recommended Posts

hi

 

I have a form with 3 check boxes

 

          chkbox 1    chkbox 2    chkbox 3

id        home 1      home2        home3

 

user can check lets say box 1

 

i know how to automaticaly sent an email to the user.

 

my question is... Can I sent him the checkbox id, in this case "home1", also?

Link to comment
https://forums.phpfreaks.com/topic/108281-email-results/
Share on other sites

try bellow

<input type="checkbox" name="checkbox[]" value="<?php echo $checkbox1['id']?>" >
<input type="checkbox" name="checkbox[]" value="<?php echo $checkbox2['id']?>" >
<input type="checkbox" name="checkbox[]" value="<?php echo $checkbox3['id']?>"> 

 

Now you just can get checked checkbox values that means the id suppose 'home1' in the $_POST['checkbox'] array. like bellow:

if 1st checkbox is selected then after submitting the value of $_POST['chekbox'] will be

array(

    0 => 'home1'

)

 

hope this will help u.

Link to comment
https://forums.phpfreaks.com/topic/108281-email-results/#findComment-555137
Share on other sites

so..

 

1st i change chkbox value - ok

 

2nd as i see it i write an array for each one of them - ? (I do it inside the email or anywhere?)

 

3rd what if the user checks 2 boxes? how do i determine that? or when i write the arrays what ever is checked it will be displayed? what 0 stants for? it means i continue 1=> home2 etc?

Link to comment
https://forums.phpfreaks.com/topic/108281-email-results/#findComment-555150
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.