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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:22:50+00:00 2026-06-10T22:22:50+00:00

I am creating a basic Facebook app, and when a user without permission visits

  • 0

I am creating a basic Facebook app, and when a user without permission visits the app, they are redirected to the authorisation page. However, the page doesn’t display, and I see the following error.

This content cannot be displayed in a frame

Opening it in a new window then shows the authorisation page for my app. Clicking ‘Go to App’ then takes me to the App, but in it’s own window, away from Facebook. Going back to FB and reloding the App page now works.

Stranger yet, when I am logged out and go to my app page, I get a Facebook 404 page (4oh4.php).

I’m guessing that I am doing this wrong somehow, so can anyone see anything obvious wrong with my script? Thanks.

To see what is happening – http://apps.facebook.com/dyne_drewett_news/

<?php
require 'fb/facebook.php';

$fbconfig['appUrl'] = 'my-app-url';    // Create An instance of our Facebook Application.
$facebook = new Facebook(array(
    'appId'  => 'my-app-ID', // Entered correctly in actual script
    'secret' => 'me-app-secret', // Entered correctly in actual script
    'cookies' => 'true',
));

// Get the app User ID
$user = $facebook->getUser();

if($user) :
    try{       // If the user has been authenticated then proceed
        $user_profile = $facebook->api('/me');
    } catch (FacebookApiException $e){
        error_log($e);     
        $user = null;
    }
endif;

// If the user is authenticated then generate the variable for the logout URL
if($user) :
    $logoutUrl = $facebook->getLogoutUrl();
?>

<!-- My HTML goes here -->

<?php
else :
    $loginUrl = $facebook->getLoginUrl();
    header('Location: '.$loginUrl);
endif;
?>
  • 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-10T22:22:52+00:00Added an answer on June 10, 2026 at 10:22 pm

    Because you are working in an iframe, you’ll have to execute JavaScript redirects. Only that way will you be able to redirect the top most frame –

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

    This is the only way to do complete redirects within a Facebook application. Any other redirect (with PHP for example) will only redirect the user within the iframe…

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

Sidebar

Related Questions

What should I read for creating a basic augmented reality app for android? I
I have an app called static HTML (https://apps.facebook.com/static_html_plus/?ref=ts) installed on a page of mine..
I am working on my first ever android app, and I'm creating basic exercise/calorie
I'm creating a basic concurrent server allowing a user to download a file using
I am creating a basic app with health tips. I need screens to get
Im creating a very basic Android App. All it does is renders a mobile
I am creating a basic image browsing application using Silverlight. Depending on the user's
I'm creating a basic blog app with rails/mongoid backend and an iOS client that
I'm creating a simple proof-of-concept web-app that integrates with Facebook. The base functionality is
creating a basic log in page - it was working but then we changed

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.