Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7527985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:15:05+00:00 2026-05-30T04:15:05+00:00

I am creating a Facebook fan-gate that when a user likes my page it

  • 0

I am creating a Facebook fan-gate that when a user likes my page it will show a form that will allow a user to enter a competition.

How would i go about checking if the user has already entered the competition.

So when the browsers requests the iframe containing my Facebook page, my php file will first check if the user has already entered the competition(based on the user facebook id), if they have then show a certain image, if not show the input form for the competition.

edit

so this is my code at the moment

<?php
require_once 'facebook-php-sdk/src/facebook.php';
$fbAppArray = array(
    'appId'  => 'xxx',
    'secert' => 'xxxxxxx',
);
$fbAppObj = new Facebook( $fbAppArray );
$signedRequest = $fbAppObj->getSignedRequest();
function parsePageSignedRequest()
{
    if( isset( $_REQUEST['signed_request'] ) )
    {
        $encoded_sig = null;
        $payload = null;
        list( $encoded_sig, $payload ) = explode( '.', $_REQUEST['signed_request'], 2 );
        $sig = base64_decode( strtr( $encoded_sig, '-_', '+/' ) );
        $data = json_decode( base64_decode( strtr( $payload, '-_', '+/' ), true ) );
        return $data;
    }
    return false;
}  
?>

i then call this

<?php
if( $signedRequest == parsePageSignedRequest() )
{
    if( $signedRequest->page->liked )
    {
        echo "you liked me";
    }else{
        echo "Please like the application so you will be able to see the contents...";
    }
}
?>

this is too check if the user has liked the page or not, but it does not seem to work.
( $signedRequest->page->liked ) this seems to always evaluate to false even if the user liked the page

any ideas why?

Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:15:06+00:00Added an answer on May 30, 2026 at 4:15 am

    i hope you are storing the results of form submission in a table, you can store a userID column there containing the facebook’s userID, and then can match against it, you will “have” to get users basic information. the other option is to have user type there email, but it is not guranteed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a poll script for a facebook fan page: http://www.facebook.com/apps/application.php?id=115400635147687&v=app_115400635147687 I am
I am creating Facebook application which get insights for user's page for multiple metric.
I`m an admin on a facebook fan page. The problem is that when I
I am creating a Facebook application that will download all the photos in an
I'm creating an iPhone App that uses facebook connect to enable the user to
I am creating a facebook application in asp.net. I want that when user login
I am creating a Facebook application that will integrate into a mobile version of
I am creating a Facebook application which should allow the user do post something
I am creating an app for Facebook and twitter integration using sharekit. That works
Ok guys I'm creating an application in CodeIgniter that utilizes the Facebook SDK, both

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.