Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Facebook registration plugin

  • 29-10-2011 01:49PM
    #1
    Registered Users, Registered Users 2 Posts: 459 ✭✭


    If anyone could kindly nudge me in the correct direction I'd be greatly appreciate it.

    The sheer amount of (outdated) info on facebook-connect and methods that are no longer standard is mind-boggling, simply what I want to do is:

    From my website --> ask user to register/connect with FB account --> INSERT username and email into my MySQL schema...

    The Facebook Registration Plugin claims to do this but goes as far as issuing a "signed_request" and any or all of the info out there talks of "connect Url's" in the app CP which are n0 longer there?

    For example, here's a tutorial titled 'How to Authenticate Users With Facebook Connect' from Jun 10th 2010

    I fail at the first hurdle
    [PHP]<?php
    # We require the library
    require("facebook.php");

    # Creating the facebook object
    $facebook = new Facebook(array(
    'appId' => 'YOUR_APP_ID',
    'secret' => 'YOUR_APP_SECRET',
    'cookie' => true
    ));

    # Let's see if we have an active session
    $session = $facebook->getSession();

    if(!empty($session)) {
    # Active session, let's try getting the user id (getUser()) and user info (api->('/me'))
    try{
    $uid = $facebook->getUser();
    $user = $facebook->api('/me');
    } catch (Exception $e){}

    if(!empty($user)){
    # User info ok? Let's print it (Here we will be adding the login and registering routines)
    print_r($user);
    } else {
    # For testing purposes, if there was an error, let's kill the script
    die("There was an error.");
    }
    } else {
    # There's no active session, let's generate one
    $login_url = $facebook->getLoginUrl();
    header("Location: ".$login_url);
    }
    ?>
    [/PHP]
    ...nothing but blank page - I can't even find where to enter connect Url in app CP.


Advertisement