user998521
user998521

Reputation: 37

Redirect to custom page from facebook domain after registratiomn

I am trying to implement Fb registration in my site.I want to redirect it to my custom page (under the same domain) after registration.. how should I code? anyone please help me....

Code is here...But it is not redirecting to the specified redirect url..... Is there any other way?? please help....

<fb:login-button registration-url="https://www.facebook.com/plugins/registration.php" redirect-uri="<REDIRECT URL>" />Register</fb:login-button>

Upvotes: 0

Views: 365

Answers (2)

Jim
Jim

Reputation: 11

It's "redirect-uri" not "redirect-url" as the parameter.

Upvotes: 1

Awais Qarni
Awais Qarni

Reputation: 18016

It can be implemented. Either using fb registration like this

 <body>
  <div id="fb-root"></div>
  <script src="http://connect.facebook.net/en_US/all.js">
  </script>
  <script>
     FB.init({ 
        appId:'YOUR_APP_ID', cookie:true, 
        status:true, xfbml:true 
     });
  </script>
     <fb:registration
        fields="[{'name':'name'}, {'name':'email'},
        {'name':'favorite_car','description':'What is your favorite car?',
        'type':'text'}]" redirect-uri="URL_TO_LOAD_AFTER_REGISTRATION">
</fb:registration>
</body>

OR there can be another way. just place login button and capture the login event and redirect the user to your desired url like this

<body>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({appId: '<?= YOUR_APP_ID ?>', status: true,
           cookie: true, xfbml: true});
  FB.Event.subscribe('auth.login', function(response) {
   //self.location.href='some url' // redirect where do you want
  });
</script>

Upvotes: 0

Related Questions