I am attempting to get users facebook name etc via an app I am building. I am aware users will have to authorize this. I am looking at the facebook documentation but am having trouble getting to grips with exactly what I need to do.
I am loading my app as a canvas page. I have got the signed request such etc as in
if page is already liked do this:
if not show like our page option.
The page that is displayed after you have liked it has a question on which if you answer it will enter you into a competition. rather than having users fill out name and email I would like to enable oauth to get these details.
any ideas? thanks in advance
exisitng code:
if ($like_status ==”1″)
{
if ( !empty ( $_REQUEST['enter_competition'] ) )
{
$name = "";//needs to be amended to what we get from Facebook
$email = "";//needs to be amended to what we get from Facebook
if ($_REQUEST['answer']==$correctanswer)
{
$result = "Correct";
}
else
{
$result= "Incorrect";
}
$insert = mysql_query ("INSERT INTO competition ( name, email, answer ) VALUES ('".$name."', '".$email."', '".$result."')",$db);
$displayforuser="true";
}
?>
didnt use ouath in the end. just collected manually. and I did read through the documentation as I stated in the original Q