[bbDev] Additional Registration Field

Matt matt at didcoe.id.au
Tue Feb 7 13:29:20 GMT 2006


Hi,
 
I’m trying to add an addition field to the registration form which is
required (terms and conditions).
 
It’s a checkbox and I’ve got it to appear on the page using the code
below. The problem lies in the validation (which is also below). Any
ideas??? It keeps saying it’s not valid or there :S
 
Checkbox code:
            <td><?php if ( $key == 'terms' ) : ?><input name="<?php echo
$key; ?>" type="checkbox" id="<?php echo $key; ?>" value="<?php echo
$$key; ?>"/><?php else : ?><input name="<?php echo $key; ?>" type="text"
id="<?php echo $key; ?>" size="30" maxlength="140" value="<?php echo
$$key; ?>" /><?php endif;
 
Validation code:
       foreach ( $profile_info_keys as $key => $label ) :
              if ( is_string($$key) ) :
                     $$key = bb_specialchars( $$key, 1 );
              elseif ( is_null($$key) ) :
                     $$key = bb_specialchars( $_POST[$key], 1 );
              endif;
              if ( !$$key && $label[0] == 1 ) :
                     $bad_input = true;
                     $$key = false;
              endif;
       endforeach;
 
 
Thanks,
 
Matt Didcoe
Freelance Website Designer / Developer
HYPERLINK "http://www.didcoe.id.au/"www.didcoe.id.au
HYPERLINK "mailto:matt at didcoe.id.au"matt at didcoe.id.au
 
Member – Port 80, Australian Web Industry Association – HYPERLINK
"http://www.port80.asn.au/"www.port80.asn.au
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.2/252 - Release Date:
6/02/2006
 


More information about the bbDev mailing list