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

  • Home
  • SEARCH
  • 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 7040083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:52:33+00:00 2026-05-28T01:52:33+00:00

I have a picture contest using php which allows you to enter to upload

  • 0

I have a picture contest using php which allows you to enter to upload or enter to vote. It also only allow one facebook user to upload one picture to the event at most.

How can I validate their facebook ID with MySQL data, such that the same user who already submitted once (according to the fbID) is not able to click the enter contest button again and when clicked, a msg box will pop out saying “You have already submitted once”?

Hope you guys will give suggestions. Thanks and appreciated all of your time for helping me.

  • 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-28T01:52:34+00:00Added an answer on May 28, 2026 at 1:52 am

    Simply store the Facebook user ID alongside the photo submission in your database.

    I assume you’ll have a table that contains the photo data; create a new field to store the Facebook user ID too. Then, when the user visits your app or whatever, check if their ID is already in the database. If so, don’t give them the upload form but an error message; if not, allow them to upload.

    EDIT: Check out Facebook’s SDK. There should be example’s on there to fetch the details of the user viewing your app’s page, which includes Facebook ID. You can then use that in your script.

    <?php
    
    require 'facebook.php';
    
    $facebook = new Facebook(array(
        'appId'  => 'YOUR_APP_ID',
        'secret' => 'YOUR_APP_SECRET',
    ));
    
    $user = $facebook->getUser();
    
    if ($user) {
        try {
            $user_profile = $facebook->api('/me');
        }
        catch (FacebookApiException $e) {
            error_log($e);
            $user = null;
        }
    }
    
    if ($user) {
        $logoutUrl = $facebook->getLogoutUrl();
    }
    else {
        $loginUrl = $facebook->getLoginUrl();
        echo "<script>top.location.href='$loginUrl';</script>";
        exit;
    }
    
    // if we're here, the user has successfully authenticated
    // you now have access to their profile in $user_profile
    
    $userId = intval($user_profile['id']);
    
    // logic goes here to query database and check if $userId
    // has already been used to submit a photo or not
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to upload a picture to a specific website using php cURL but
Hey all, I've made a facebook application for a contest, which allows users to
I have a picture box on my form, which I add a picture to.
I have the picture box in which the image may be zoomed with different
I have my signed assemblies here, in one of them I have a picture
Basically what I'm trying to do is have a picture rotate using mouse events.
Hi I am using visual studio 8, vb.net. I have a picture box on
In Excel I have attached a picture to a cell using the following Sub
I have a scroll view (shown in the picture below). It allows the user
HI all, I have a picture box in my C# WinForms application which is

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.