Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-26-2003, 10:57 AM   #1
Registered User
Join Date: Jul 2003
Posts: 8
Default PHP variables for check boxes

I'm using a mail contact form that has several check boxes along with a comments box and user's email, etc.....i have it working so far but i don't know what PHP variables to assign to the check boxes. How would i get the selected check boxes to show up in the final email? Can't find help on this anywhere so far.....
nickel is offline   Reply With Quote
Old 08-27-2003, 10:54 PM   #2
Master of Nothing
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468

Does each checkbox belong to the same group? I provided an exaple for both single items and for grouped items

PHP Code:
"You selected:<br>";
$_REQUEST['options'] as $k => $v)
$_REQUEST['newsletter'] != "")
"Should I subscribe: ".$_REQUEST['newsletter'];
"Should I subscribe: no";
<form action="<?php print $GLOBALS['PHP_SELF']; ?>" method="post">
<input type="checkbox" name="options[]" value="option 1">Option 1<br>
<input type="checkbox" name="options[]" value="option 2">Option 2<br>
<input type="checkbox" name="options[]" value="option 3">Option 3<br>
<input type="checkbox" name="options[]" value="option 4">Option 4<br>
<input type="checkbox" name="options[]" value="option 5">Option 5<br>
<input type="checkbox" name="options[]" value="option 6">Option 6<br>
<input type="checkbox" name="options[]" value="option 7">Option 7<br>
<input type="checkbox" name="options[]" value="option 8">Option 8<br>
<input type="checkbox" name="options[]" value="option 9">Option 9<br>
<input type="checkbox" name="options[]" value="option 10">Option 10<br>
<input type="checkbox" name="options[]" value="option 11">Option 11<br>
<input type="checkbox" name="newsletter" value="subscribe">Newsletter<br>

<input type="submit" name="submit" value="Submit">
freddycodes is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:18 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.