PHP opauth facebook

Asked

Viewed 30 times

1

I am making attention with facebook using opauth.org slim3 framework.

I’m not getting the sex.

I get the other data: test site

Does anyone know if there is a syntax error?

$gender = @$auth['raw']['gender'];

The complete code:

    switch(strtolower($auth['provider'])) {
    case 'facebook' :
        $oauth_id = $auth['uid'];
        $password = mt_rand(10000000, 99999999);
        $info = $auth['info'];
        $firstname = @explode(' ', @$info['name'])[0];
        $lastname = @explode(' ', @$info['name'])[1];
        $image = @$info['image'];
        $gender = @$auth['raw']['gender'];
        $credentials = serialize(@$auth['credentials']);
        if (!empty ($username = $info['email'])) $this-> $username = @$info['email'];

        else  {
        $username = $oauth_id;

        }
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.