Davie33 Posted March 19, 2012 Share Posted March 19, 2012 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 More sharing options...
btherl Posted March 20, 2012 Share Posted March 20, 2012 Please post your PHP code. Link to comment https://forums.phpfreaks.com/topic/259287-url-problem-with-facebook-social-login/#findComment-1329249 Share on other sites More sharing options...
Davie33 Posted March 20, 2012 Author Share Posted March 20, 2012 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); } ?> Link to comment https://forums.phpfreaks.com/topic/259287-url-problem-with-facebook-social-login/#findComment-1329534 Share on other sites More sharing options...
btherl Posted March 20, 2012 Share Posted March 20, 2012 I can't help you with that unfortunately. I'm not familiar with the facebook API. Link to comment https://forums.phpfreaks.com/topic/259287-url-problem-with-facebook-social-login/#findComment-1329641 Share on other sites More sharing options...
caie Posted April 24, 2012 Share Posted April 24, 2012 Why don't you try loginradius?You just have to copy and paste php code, then you not only get facebook api but also 20 more apis. You can see step by step instructions at, https://www.loginradius.com/plugins/phpsdk Link to comment https://forums.phpfreaks.com/topic/259287-url-problem-with-facebook-social-login/#findComment-1340090 Share on other sites More sharing options...
Davie33 Posted May 19, 2012 Author Share Posted May 19, 2012 Forgot about this post but got fb and twit url sorted thanks.Thanks for the link . Link to comment https://forums.phpfreaks.com/topic/259287-url-problem-with-facebook-social-login/#findComment-1346773 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.