Jump to content

How can I add various checkboxes to my Form Fillout page ?


WilliamGrant

Recommended Posts

Hey guys,

 

So basically I created a page where people fill out some information such as their name, e-mail, phonenumer etc.

This works perfectly by now.

I also would like them to be able to check 6 checkboxes as optional fields something like:

"I like to eat : (checkbox 1 ) cookies - (checkbox 2 ) chocolate .. etc"

 

So when I give each html checkbox a name and id such as "cookies"

how do I process this information in my php formscript?

 

would it look like this?

 

<?php session_start();
if(isset($_POST['Submit'])) {
$youremail = '[email protected]';
$fromsubject = 'subject email';
$chocolate = $_POST['chocolate'];
$cookies = $_POST['cookies'];

$to = $youremail; 
$mailsubject = ''.$fromsubject.' actionpage';
$body = $fromsubject.'
Cookies:  '.$cookies.'

?> 

 

The idea is that I will receive an e-mail that will tell me whether a box was checked or not and I am not sure how to make it work exactly.

 

any help would be really awesome!

 

 

William

Hi Chad!

 

Thanks for you reply!

This certainly looks like the direction I need.

Would you mind expanding a little bit on this idea?

I'll be honest, I'm a graphic designer and learning my way into PHP but I'm really not that good at it (yet) haha

 

Anyway,

 

If you could direct me a little in where I should I place that "if statement" and how I can make it appear in my e-mail box  like you said, I would technically be done with my website finally :-)

 

right now the output of a mail being sent to me through the form looks something like:

 

Name : jreklgfjer

Address : fjerkfn

Phone : 572348953

 

So I think when a box was checked it should appear something like this in my mailbox

 

additional boxes checked:

Cookies

Chocolate

Pie

 

I hope this makes sense lol

 

Much thanks!

 

William

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.