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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:58:51+00:00 2026-06-10T20:58:51+00:00

How is it possible to redirect the user to another page when he likes

  • 0

How is it possible to redirect the user to another page when he likes a page tab?

I followed this tutorial :
http://developers.facebook.com/docs/appsonfacebook/pagetabs/

All is working perfectly but i need to display another page if he likes the page tab.
Same problem if he unlikes the page. The previous page should reappear….

this is the code i found but not working…

<?php
require 'php-sdk/src/facebook.php';
?>

<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>


    </head>
    <body>
            you don't like yet

    </body>

    <script>
        FB.api(pageId +  '/likes', 'post' ,function(response) {


            location.href = 'youlike.php';

        });
    </script>
</html>

I hope i’m clear enough.

If you want to test yourself : http://www.facebook.com/Luthe131
the page tab is test app

thank you in advance

  • 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-10T20:58:53+00:00Added an answer on June 10, 2026 at 8:58 pm

    I see you are using php sdk, Lets do it by php, you dont need to use FB.api() to check your own page is liked or not.here is how to do it,

    $facebook = new Facebook(array(
          'appId'  => APP_ID,
          'secret' => APP_SECRET,
          'cookie' => true,
        ));
    
        $signedRequest = $facebook->getSignedRequest();
        $liked = $signedRequest["page"]["liked"];
    

    Now if the user liked the page, $liked will be 1,
    now,

    `if($liked){
        header("Location:youlike.php");
     }else{
     echo "you didnt like";
     }` 
    

    oh, and facebook refreshes the app when like button is triggered. so, value of $liked will change accordingly.

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

Sidebar

Related Questions

I am wondering if it's possible to redirect a user to another page from
Is it possible with the Facebook OpenGraph's and API's to redirect user to a
Is it possible to redirect a user to a php page and then redirect
Possible Duplicate: How to redirect users to another page? I'm a beginner in the
I have a page which needs to redirect a user to another separate system
Is it possible, if so how(!), to auto redirect a user that doesnt have
Is it possible to do a URL rewrite where a url like http://www.myurl.com/usa/california/sanjose redirects
I have a download folder. So is it possible to redirect a user to
Possible Duplicate: How to redirect from one URL to another URL? I have the
Possible Duplicate: Play Framework appending # = to redirect after Facebook auth via OAuth2?

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.