This question already has answers here:
Answer
Solution:
You can't place html elements inside php, you need to end your php code before the html element and start php again after it.
<?php
if( wc_memberships_is_user_member( null, 3171 ) ) {
?>
<input id="facebook" class="form-control" type="url" name="user[facebook]" value="<?php echo !empty($facebook) ? esc_attr($facebook) : ''; ?>" placeholder="<?php esc_html_x('Enter your facebook url', 'placeholder', 'direo'); ?>" />
<?php
}
?>
Source