[phorm] [Phorm:] Re: Check box question

  • From: webbbs@xxxxxxxxx
  • To: support@xxxxxxxxx
  • Date: 2 May 2003 04:37:50 -0000

The following new message has been posted on Phorm Support Forum at 
<http://www.phorm.com/support/>. 

*************************************************************************** 

  MESSAGE:  (#2619) Re: Check box question 
            <http://www.phorm.com/support/?rev=2619> 
  AUTHOR:   Patrick O'Hara 
  DATE:     May 2, 2003 at 12:37 a.m. EST 

  Reply To: (#2618) Check box question 
  Author:   Rich 
  Date:     May 2, 2003 at 12:16 a.m. EST 

Hi Rich, In your config file, write some PHP code to work out where each 
should go... if I understand what you want to do, something like this might 
help, although you'll need to tweek it. 

Set up the names of the checkboxes to have the same name, differing only by an 
interger at the end. i.e. file0, file1, file2, ... , file7. 

$nextSection = 1; 
for ($i = 0; $i > 8; $i++) { 
-- $varName = "file" . $i; 
-- if (isset($$varName)) { 
---- $sectionName = "section" . $nextSection++; 
---- $$sectionName = $$varName; 
-- } 
} 

The values of the selected checkboxes will be passed to the variables: 
$section1, $section2, $section3, ... etc, they will be assigned in order of 
the first (starting at file0) occuring file, to $section1, the second to 
$section2, etc. 

The for loop says cycle through all the checkboxes, starting from file0 ending 
at file7, the next line sets the variable name. if it's set, set the variable 
name, and increment the counter for the next section. Now assign the value 
from the checkbox to that section variable. 

Have a look at www.php.net if your not sure about variable variable names. 
(the double $ signs) 

Hope this helps, 

Patrick O'Hara 
WhitsundayIT 
QLD, Australia 

patrick@xxxxxxxxxxxxxxxx 
www.whitsundayit.com 

*************************************************************************** 

This is an automatically-generated notice.  If you'd like to be removed from 
the mailing list, please visit Phorm Support Forum at 
<http://www.phorm.com/support/>, or send your request to webbbs@xxxxxxxxxx  If 
you wish to respond to this message, please post your response directly to the 
board.  Thank you! 
-------------------------------------------------
You are receiving this message because you are subscribed to the Phorm mailing 
list. To send messages to the mailing list, simply send email to 
phorm@xxxxxxxxxxxxx from the address you have subscribed. You may unsubscribe 
from the list by sending email to phorm-request@xxxxxxxxxxxxx with 
'unsubscribe' in the SUBJECT field.

Other related posts: