Jump to content

Ok to do this way?


Reaper0167

Recommended Posts

a user can go back and update their profile, to display what they previously selected from the radio buttons, i use the following

<?php if($gender_prof == 'male') { echo '
      <input name="gender" type="radio" id="gender" value="male" checked="checked" /> male  
      <input type="radio" name="gender" id="female" value="female" /> female'; } else { echo ''; } ?> 
      <?php if($gender_prof == 'female') { echo '
            <input name="gender" type="radio" id="gender" value="male" /> male  
      <input type="radio" name="gender" id="female" value="female" checked="checked" /> female'; } else { echo ''; } ?>

Is this an ok way to acomplish this, or is there a better way?

Link to comment
https://forums.phpfreaks.com/topic/196924-ok-to-do-this-way/
Share on other sites

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.