我的网站上的Facebook登录按钮 [英] facebook login button in my website

查看:96
本文介绍了我的网站上的Facebook登录按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友facebook登录我的网站工作但登录后shoyld重定向到我的注册表是可能的..





请帮助我非常紧急

hi friends facebook login on my website is working but after login it shoyld redirect to my registration form is it possible ..


please help me it is very urgent

推荐答案

Asp.net将Facebook登录认证整合到网站上。请查看以下链接。



http://www.aspdotnet-suresh.com /2012/04/aspnet-integrate-facebook-login.html [ ^ ]
Asp.net integrate Facebook login authentication to website.Please check the below link.

http://www.aspdotnet-suresh.com/2012/04/aspnet-integrate-facebook-login.html[^]


此代码将帮助您解决问题。



This code will help you in your problem.

<html>
<head>
<title>Facebook Login Authentication Example</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<script>
// Load the SDK Asynchronously
(function(d) {
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) { return; }
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
} (document));

// Init the SDK upon load
window.fbAsyncInit = function() {
FB.init({
appId: '198191300293654', // App ID
channelUrl: '//' + window.location.hostname + '/channel', // Path to your Channel File
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true  // parse XFBML
});

// listen for and handle auth.statusChange events
FB.Event.subscribe('auth.statusChange', function(response) {
if (response.authResponse) {
// user has auth'd your app and is logged into Facebook
FB.api('/me', function(me) {
if (me.name) {
document.getElementById('auth-displayname').innerHTML = me.name;
}
})
document.getElementById('auth-loggedout').style.display = 'none';
document.getElementById('auth-loggedin').style.display = 'block';
} else {
// user has not auth'd your app, or is not logged into Facebook
document.getElementById('auth-loggedout').style.display = 'block';
document.getElementById('auth-loggedin').style.display = 'none';
}
});


(#auth-logoutlink)。click(function(){FB.logout(function(){window.location.reload ();});});
}
< / script >
< h1 >
Facebook登录验证示例< / h1 >
< div < span class =code-attribute> id = auth-status >
< div id = auth-loggedout >

< div class = fb-login-button autologoutlink = true 范围 = email,user_checkins > 使用Facebook登录< ; / div >
< / div >
< div id = auth-loggedin style = display:none >
您好,< span id = auth-displayname > < / span > < a href = id = auth-logoutlink > 注销< / a >
< / div >
< / div >
< / body >
< / html >
("#auth-logoutlink").click(function() { FB.logout(function() { window.location.reload(); }); }); } </script> <h1> Facebook Login Authentication Example</h1> <div id="auth-status"> <div id="auth-loggedout"> <div class="fb-login-button" autologoutlink="true" scope="email,user_checkins">Login with Facebook</div> </div> <div id="auth-loggedin" style="display: none"> Hi, <span id="auth-displayname"></span>(<a href="#" id="auth-logoutlink">logout</a>) </div> </div> </body> </html>


这篇关于我的网站上的Facebook登录按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆