• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook pagefor updates, or we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.)

[PHP] If.

Status
Not open for further replies.
swagggggg
Loyal Member
Joined
Oct 28, 2008
Messages
1,557
Reaction score
368
Okay, so I've got this login script and here's how it is on the HTML code:

Code:
<strong>Choose your gender</strong><br>
											<select name="bean.gender" style="width: 200px;"><option value="m">Male</option><option value="f">Female</option></select>

So that's my HTML file, I'm including it in my register but on my register I'm not sure how to do like if 'm' selected =
Code:
// Add user
			$users->add($name, $core->uberHash($password), $email, 1, 'ch-215-92.hr-802-61.sh-908-90.hd-190-1.lg-275-82', 'M');
But how exactly would I make the if to do if 'f' selected =
Code:
// Add user
			$users->add($name, $core->uberHash($password), $email, 1, 'hr-500-39.hd-600-7.ch-630-64.lg-695-73.sh-725-75', 'F');

Would be very appreciated since I'm not that good at PHP and only a beginner.

- Thanks!
 
Experienced Elementalist
Joined
Dec 17, 2008
Messages
209
Reaction score
31
Now, Powah, this might be advanced for a newcomer to PHP, but eh.
PHP:
			$users->add($name, $core->uberHash($password), $email, 1, 'ch-215-92.hr-802-61.sh-908-90.hd-190-1.lg-275-82', ($_POST['bean.gender']=="M")?"M":"F");

Enjoy.
 
Experienced Elementalist
Joined
Dec 17, 2008
Messages
209
Reaction score
31
You wanted Female clothing?

---------- Post added at 11:48 PM ---------- Previous post was at 11:47 PM ----------

PHP:
            $users->add($name, $core->uberHash($password), $email, 1, ($_POST['bean.gender']=="M")?'ch-215-92.hr-802-61.sh-908-90.hd-190-1.lg-275-82':'hr-500-39.hd-600-7.ch-630-64.lg-695-73.sh-725-75':, ($_POST['bean.gender']=="M")?"M":"F");
 
Status
Not open for further replies.
Back
Top