latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

conditional using php

Home Forums Community Forum conditional using php

This topic contains 1 reply, has 2 voices. Last updated by  Cristián Lávaque 3 years, 6 months ago.

Topic Author Topic
Posted: Wednesday Jul 10th, 2013 at 7:06 pm #53258
Mike Waller
Username: seozones

Hi there. On my registration page, i created a custom field which is called jds_role to determine if the user signing up is a parent or student (a radio button). Now, on my page I have the following:

However, on my test signup, whether I sign up as a parent or student, it always displays, “You are a Parent!”

What am I doing wrong in the above code? Also, once I figure this part out, what i need to do is add the correct code to the following so that based on how they have signed up, it will determine the level that I will convert them once they log in. Here is the code I have now which does this but converts everyone to level 2. I want it so that if a Student registers, it converts them to Level 1 and if Parent, level 2.

ID);
$user->set_role("s2member_level2"); ?>
    

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Thursday Jul 11th, 2013 at 5:25 am #53280
if ($my_field_data="Parent") {

You’re not comparing, you’re assigning that value to the var. You need to use two equal signs.

http://www.php.net/manual/en/language.operators.assignment.php
http://www.php.net/manual/en/language.operators.comparison.php

Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.