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 8747935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:26:25+00:00 2026-06-13T12:26:25+00:00

Working with the Facebook PHP SDK. I have the same .php tag in two

  • 0

Working with the Facebook PHP SDK. I have the same .php tag in two different files, in one it works but in the other it returns nothing. Any idea? I have the same config.php file included in both.

include("config.php");
include("fbconnect.php");

if (!isset($_SESSION['user']))
{
    $valor_voto = mysql_query("select voto from $mes_id where email=$email");
    $row = mysql_fetch_array($valor_voto);
    $valor = $row['voto'];

    if ($valor == 1)
    {
        echo '<img class="icon" src="/images/greencheck.png">';
    }
    else
    {
        echo '<img class="icon" src="/images/check.png">';
    }
}
else
{
    echo '<img class="icon" src="/images/check.png">';
}

Looks to me that $email is what fails because if I input the email manually it will return any of the 2 spectated values.

Thanks for the time.

$email comes from fbconnect.php:

if ($user)
{
    try
    {
        // Proceed knowing you have a logged in user who's authenticated.
        $user_profile = $facebook->api('/me');

        //Connecting to the database. You would need to make the required changes in the common.php file
        //In the common.php file you would need to add your Hostname, username, password and database name!
        mysqlc();

        $name     = GetSQLValueString($user_profile['name'], "text");
        $email    = GetSQLValueString($user_profile['email'], "text");
        $gender   = GetSQLValueString($user_profile['gender'], "text");
        $bio      = GetSQLValueString($user_profile['bio'], "text");
        $hometown = GetSQLValueString($user_hometown['hometown'], "text");
        $query    = sprintf("SELECT * FROM newmember WHERE email = %s", $email);
        $res      = mysql_query($query) or die('Query failed: ' . mysql_error() . "<br/>\n$sql");

        if ( mysql_num_rows($res) == 0 )
        {
            $iquery = sprintf("INSERT INTO newmember values('',%s,%s,%s,%s,'yes',%s)", $name, $email, $gender, $bio, $hometown);
            $ires   = mysql_query($iquery) or die('Query failed: ' . mysql_error() . "<br/>\n$sql");

            $_SESSION['user'] = $user_profile['email'];
            $_SESSION['id'] = $user_profile['id'];

        }
        else
        {
            $row = mysql_fetch_array($res);
            $_SESSION['user'] = $row['email'];
            $_SESSION['id'] = $user_profile['id'];
        }
    }
    catch (FacebookApiException $e)
    {
        error_log($e);
        $user = NULL;
    }
}
  • 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-06-13T12:26:26+00:00Added an answer on June 13, 2026 at 12:26 pm

    Solved, i had the condition

    if(!isset($_SESSION['user']))
    

    but i wasn’t giving the condition

    if(isset($_SESSION['user']))
    

    so i wasn’t able to retrive any info.

    Thanks for the time.

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

Sidebar

Related Questions

I am integration Facebook connect in my website using php SDK.. Everything is working
What I have here is a PHP page working with the Facebook API. What
Working with the Facebook php SDK's, I am having a lot of trouble figuring
I am using the PHP library for the Graph API ( http://github.com/facebook/php-sdk ) but
I am trying some facebook php sdk 3.0 tutorial but i get the error:
I have an iframe Facebook application that uses the Facebook PHP SDK to authenticate
I coded a facebook app in PHP with php-facebook sdk, that is working absolutely
I am working on a facebook game in PHP, and one of the things
I have downloaded an example of Facebook Application using PHP sdk, and it is
I have a Facebook application where I authorize the user using the PHP SDK.

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.