KDM Posted July 26, 2011 Share Posted July 26, 2011 I'm trying to allow users to register and select their gender, and then have that info sent to the database. Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted July 26, 2011 Share Posted July 26, 2011 <html> <head> <title>My Page</title> </head> <body> <form name="myform" action="path/to/php/file.php" method="POST"> <div align="center"><br> <input type="radio" name="group1" value="Milk"> Milk<br> <input type="radio" name="group1" value="Butter" checked> Butter<br> <input type="radio" name="group1" value="Cheese"> Cheese <hr> <input type="radio" name="group2" value="Water"> Water<br> <input type="radio" name="group2" value="Beer"> Beer<br> <input type="radio" name="group2" value="Wine" checked> Wine<br> <input type="submit" name="submit" value="Submit" /> </div> </form> </body> </html> then you will grab it in file.php if(!empty($_POST['submit'])){ //check if the submit button was clicked $radio_value = $_POST['myForm']; //will be set to chosen value if($radio_value == "Milk"){ //if the user selected millk //act accordingly }elseif($radio_value == "Butter"){//if buter is selected //act accordingly } } etc... Quote Link to comment Share on other sites More sharing options...
Maq Posted July 26, 2011 Share Posted July 26, 2011 Did you try Googleing - "php registration form"? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted July 26, 2011 Share Posted July 26, 2011 Did you try Googleing - "php registration form"? lol, that is also a viable solution Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.