<?php if(isset($_POST['submit'])) { if($_POST['user_gender'] == 1) { $user_gender = male; } if($_POST['user_ender'] == 2) { $user_gender = female; }else{ echo "you must select a gender"; } } ?>Am I going in the right direction? Any tutorials?
Allowing users to register as male or female
Allowing users to register as male or female
Is this code correct
Re: Allowing users to register as male or female
It looks like it is heading in the right direction, but obviously needs completing
Re: Allowing users to register as male or female
Obviously, as Jacek send, it needs completion; I thought I'd point out to you also in case you're getting silly syntax errors:
if($_POST['user_ender'] == 2) {Has a typo on it:
if($_POST['user_gender'] == 2) {
- Linkjuice57
- Posts: 23
- Joined: Tue Jul 12, 2011 2:44 pm
Re: Allowing users to register as male or female
I would do;
And just set the radio buttons to 'male' by defaultIf user_gender == 2 { female }
else { male }
non-existent PHP newb