Skip to:
Content
Pages
Categories
Search
Top
Bottom

Checking profile field values with PHP

  • Avatar of Tudmak
    Tudmak
    Participant

    @tudmak

    At the moment I have a few profile fields for every member, and I would like to write a conditional based on the members’ choices in their profile.

    For example, if in the registration I had three chekboxes, names “A”, “B”, “C”, I would want something that would look like this:

    if (/* User chose A */) { /* do this*/;}
    
    elseif (/* User chose B */) { /* do this*/;}
    
    else (/* User chose C */) { /* do this*/;}

    Any ideas? Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Always perform a quick search first, sort of topic that has come up a few times.

    http://buddypress.org/support/search/?bbp_search=profile+fields

    keep scrolling down through them, you’ll find example code to work from.

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    Note: With checkboxes you have to be careful because the user can choose both A and B, they can even choose A B and C. The way you’ve wrote your pseudo logic above you might want to go with radio buttons.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.