Jump to content

url problem with facebook social login


Davie33

Recommended Posts

Hi i have a facebook login social plugin made but my ? is why do i get symbols in my url link ?.

I login with the plugin to facebook but when page returns me back to my site i have symbols at the end of url.

Like this http://www.games-flash.co.uk/#_=_

 

Ps sry if i have made this post in wrong section.

Link to comment
https://forums.phpfreaks.com/topic/259287-url-problem-with-facebook-social-login/
Share on other sites

Hi this is the login file for facebook.

 

<?php
require '';
require ';
$facebook = new Facebook(array(
            'appId' => $setting['fb_app_id'],
            'secret' => $setting['fb_app_secret'],
            ));

$user = $facebook->getUser();

if ($user) {
  try {
    $user_profile = $facebook->api('/me');

  } catch (FacebookApiException $e) {
    error_lxog($e);
    $user = null;
  }

    if (!empty($user_profile )) {
        $username = $user_profile['name'];
	$uid = $user_profile['id'];
	$email = $user_profile['email'];
        $user = new User();
        $userdata = $user->checkUser($uid, 'facebook', $username, $email);
        
	if(!empty($userdata)){
            $_SESSION['userid'] = $userdata['id'];
		$_SESSION['oauth_id'] = $uid;
            $_SESSION['user'] = $userdata['username'];
		$_SESSION['email'] = $email;
            $_SESSION['oauth_provider'] = $userdata['oauth_provider'];
            $now = time();
		$query = yasDB_select("SELECT `id` FROM `membersonline` WHERE `memberid` = '{$userdata['id']}'");
		if ($query->num_rows==0) {
			yasDB_insert("INSERT INTO `membersonline` (id, memberid, timeactive) VALUES ('', '{$userdata['id']}', '$now')",false);
		}
		else {
			yasDB_update("UPDATE `membersonline` SET timeactive='$now' WHERE `memberid`='{$userdata['id']}'");
		}
		header("Location: ".$setting['siteurl']);
		exit;
        }
    } else {
        die("There was an error.");
    }
} else {
    $login_url = $facebook->getLoginUrl(array( 'scope' => 'email'));
    header("Location: " . $login_url);	
}
?>

  • 1 month later...
  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.