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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:37:06+00:00 2026-06-09T05:37:06+00:00

I created a Facebook page, added a new Tab with an application. Now I

  • 0

I created a Facebook page, added a new Tab with an application.

Now I want todo these steps:

  1. See if User liked the page // Is Working
  2. Ask for permissions to post a status // Isn’t working
  3. Finish.

This is the code which I use:

$permissions = array (
    'email',
    'user_status',
    'publish_stream',
    'status_update'
);

public function __construct($app_id, $secret, $perm)
{

        $this->facebook = new Facebook(array(
            'appId'  => $app_id,
            'secret' => $secret,
            'cookie' => true
        ));
        $this->perm = $perm;
}


        public function checkPermissions()
        {
            $allPerm = true;
            $permissions = $this->facebook->api("/me/permissions");
            foreach($this->perm as $value)
            {
                if(!array_key_exists($value, $permissions['data'][0]) ) {
                    $allPerm = false;
                }
            }
            return $allPerm;
        }

        public function RequestPermissions()
        {
            header( "Location: " . $this->facebook->getLoginUrl($this->GenerateScope()) );
        }

    public function GenerateScope()
    {
        $scope = null;
        $last_key = array_keys($this->perm);
        $last_key = end($last_key);
        foreach ($this->perm as $key => $value) {
            if ($key == $last_key) {
                $scope .= $value;
            } else {
                $scope .= $value . ',';
            }
        }
        return array("scope" => $scope);
    }

So, I check for the Permissions, if not all are set, I want to ask for them.
$this->facebook->getLoginUrl($this->GenerateScope()).

But when i display the link, or redirect to it, nothings (really nothing) happens?

  • 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-09T05:37:07+00:00Added an answer on June 9, 2026 at 5:37 am

    Your tab application is operating within an iframe element on facebook.com. To redirect users to a different URL, you’ll have to change the top most frame’s location.
    This is possible using JavaScript, so all you have to do is get your PHP code to echo out this JavaScript code –

    $url = $facebook->getLoginUrl(...your_params...);
    
    echo "<script language=javascript>";
    echo "top.location.href ='".$url."';";
    echo "</script>";
    exit();
    

    That will execute the redirect for your users.

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

Sidebar

Related Questions

I have created a business page on facebook and added application to a tab.
I have created this fan page http://www.facebook.com/pages/ohlala/327385737341 and added an application on tab "Special
I have created a simple Facebook app and added it as a tab page.
I have created Facebook registration page, What i want to do is user can
I've created a facebook fan page and added a custom tab to that page
I have created a Facebook app, added it to a Facebook Fan page and
I have created a page in facebook. I have added a couple of tabs
I created and application in facebook (it's in sandbox mode). I added a connect
I have created a Facebook page a while ago, but now when i typ
I have created a new Facebook app. Whenever I visit the canvas page (https://apps.fac...)

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.