Skip to:
Content
Pages
Categories
Search
Top
Bottom

Check if a field is empty


  • Emineminero
    Participant

    @emineminero

    Hi, i would like to check if a field is empty or not.
    This would happen when the user Log in.
    Actually i have a Page Template with a piece of code that redirects the person to their profile to edit it, but i would like to detect if the user has the fields completed or not.
    Here is what i’ve been working on, but its not working:

    <?php
    );
    if (bp_get_profile_field_data(‘field=36’) == ""){ //36 is the id of the field 
    i want to check
    ?>
    
    <?php 
    $var1 = bp_loggedin_user_domain();
    $var2 = BP_XPROFILE_SLUG ;
    $var3 = '/edit/group/1';
    $location = $var1.$var2.$var3;
    
    header("location: $location" );
    }
    ?>
    <?php else { ?>
    	<?php 
    
    	header("location: http://www.url.com" );
    	}?>
    <?php endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Check if a field is empty’ is closed to new replies.
Skip to toolbar