How to save the 'checked' radio button state in database
-
Hi,
In my registration page I put a radio button to check the user_role and I want to know how to save the value of the ‘checked’ radio button in my database.
I already added a part of code to save this value in usermeta table but nothing appears!
this is a part of my php code:
<?php $role_info = $_POST['role_info']; ?> <label for="user-role-type"><?php _e('What are you?',$current_theme_locale_name) ?></label> <input type="radio" class="do_input" name="role_info" id="role_info" value="User" checked="checked"><?php echo __( 'User', $current_theme_locale_name ); ?> <br /> <input type="radio" class="do_input" name="role_info" id="role_info" value="Seller"><?php echo __( 'Seller', $current_theme_locale_name ); ?> <?php update_user_meta($user_id, 'role_info', $role_info); ?>
Any help will be appreciate, Thanks in advance
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to save the 'checked' radio button state in database’ is closed to new replies.