moriahcgibbs Posted January 7, 2012 Share Posted January 7, 2012 i made a simple survey form and i cant figure out how to make radio buttons work correctly in the form. All of the input is text, but there is one question on the form that asks for gender. I am a noob to php and i cant figure out how to make the radio buttons work.please help. Link to comment Share on other sites More sharing options...
viper_ Posted January 7, 2012 Share Posted January 7, 2012 for the radio button you can put this on your input form.. <input type="radio" name="gender" value="m"> Male<br><input type="radio" name="gender" value="f"> Female<br> if you want use combo box.. <select name="gender"> <option value="m">Male</option> <option value="f">Female</option></select> then in php.. //this always worksecho $_REQUEST['gender']; //this works on POST method forms onlyecho $_POST['gender']; //this works on GET method forms onlyecho $_GET['gender']; you'll get 'm' or 'f'... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.