Javascript facebook登录页面噩梦

Javascript facebook登录页面噩梦,javascript,facebook,html,asp-classic,Javascript,Facebook,Html,Asp Classic,嗨,伙计们,这是一个很大的要求,也是一个很长的机会,但接下来 我有一个经典的ASP网站,我想把注册过程集成到facebook上,但我不知道怎么做。我已经搜索了好几天,找到了各种各样的信息,但我似乎仍然无法理解这个应该相当简单的过程 我已经成功地使用facebook部件获得注册,这会将facebook用户ID和access_令牌写入SQL数据库,但我不知道如何更改我的登录页面,以便我的站点知道用户已成功通过身份验证 下面是目前对我的用户进行身份验证的代码 <% Const adCmdTex

嗨,伙计们,这是一个很大的要求,也是一个很长的机会,但接下来

我有一个经典的ASP网站,我想把注册过程集成到facebook上,但我不知道怎么做。我已经搜索了好几天,找到了各种各样的信息,但我似乎仍然无法理解这个应该相当简单的过程

我已经成功地使用facebook部件获得注册,这会将facebook用户ID和access_令牌写入SQL数据库,但我不知道如何更改我的登录页面,以便我的站点知道用户已成功通过身份验证

下面是目前对我的用户进行身份验证的代码

<% 
Const adCmdText = 1   
'On Error Resume Next
SQSecureDSN="Provider=SQLNCLI10;Server=;Database=; Trusted_Connection=yes;"
Redirpath=""
Set SQLog = Server.CreateObject("ADODB.Connection")
SQLog.open SQSecureDSN

tmpUsername=replace(Request.Form("username"),"'","")
tmpUsername=replace(tmpusername,"""","")
tmpPW=replace(Request.Form("password"),"'","")
tmpPW=replace(tmpPW,"""","")

if tmpPW & "X" <> "X" Then
    strSQL = "SELECT * FROM users WHERE username=? AND password=? AND enabled ='TRUE';"
    Dim cmd1
    Set cmd1 = Server.CreateObject("ADODB.Command")    
    cmd1.ActiveConnection = SQLog
    cmd1.CommandText = strSQL
    cmd1.CommandType = adCmdText
    cmd1.Parameters(0) = tmpusername
    cmd1.Parameters(1) = tmpPW
    Set rstLogin = cmd1.Execute()
    If  rstLogin.EOF Then
      ResponseMessage="<tr><td colspan=2><b><h1 style=color:red;>Login failed!</h1><br>     <p>Have you activated your account?.. If not please <a href='submitreg.asp'>Click Here</a>    </p></td></tr><tr><td><br></td></tr><tr><td colspan=2><p>If you have forgotten your password please <a href='mailto:xxxxx.com'>Click Here</a></p></td></tr><tr><td><br></td></tr>"
    else
      lognSQL= "SELECT [ID], client, admin ,username FROM users where username='" &     tmpusername & "' AND password='" & tmpPW & "' AND enabled ='TRUE';"
      Set logn = SQLog.execute(lognSQL)
      if not logn.eof then 
        lookupun = logn("username")
        lookupid = logn("ID")
        lookupad = logn("admin")
        lookupcl = logn("client")
      end if
      Session("usern") = tmpUsername
      Session("AuthID") = lookupid
      Session("admin") = lookupad
      Session("clientID") = lookupcl
      LogSQL= "UPDATE TSession SET clientID='" & lookupcl &"', userid='" & lookupid & "' where [Key]='" & Request("SessKey") & "';" 
      SQLog.execute(LogSQL)
      RedirPath=request("redirect")
    end if
    SQLog.Close()
    set SQLog = nothing
    set SQConn = nothing
    If Redirpath<>"" Then response.Redirect(Redirpath)
end if
%>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="viewport" content="user-scalable=no, width=device-width" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" 
      href="css/iphone.css" media="only screen and (max-width: 480px)" />
 <link rel="stylesheet" type="text/css" 
      href="css/page.css" media="screen and (min-width: 481px)" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]--> 
<script>
setTimeout(function () {
  window.scrollTo(0, 1);
}, 1000);
</script>
<title>xxxxxxxx.com</title>
</head>
<body id='header'>
<%
Function Is_Mobile()
  Set Regex = New RegExp
  With Regex
    .Pattern = "(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm)"
    .IgnoreCase = True
    .Global = True
  End With
  Match = Regex.test(Request.ServerVariables("HTTP_USER_AGENT"))
  If Match then
    Is_Mobile = True
  Else
    Is_Mobile = False
  End If
Dim user_agent
user_agent = Request.ServerVariables("HTTP_USER_AGENT")

    If InStr(1, user_agent, "ipad", 1) Then
        Is_ipad = true
    Is_Mobile = False
    Else
    Is_ipad = False
    End If
 End Function


If Is_Mobile= True Then
%>
<img align="center" class="mainlogo" id="mainlogo" src="logo_banner.jpg"/>
<%
Else
%>
<!--#include file="css/twitter.html"-->
<!--#include file="css/facebook.html"-->
<!--#include file="css/tophead.html"-->
<%
End If%>
<%
if Session("clientID") = "" then
%>
    <!--#include file="css/navibar.html"-->
    <%
Else
%>
    <!--#include file="css/clientnavibar.html"-->
    <%
End if
%>
      <p> <%=LeftPane%></p>
      <p>&nbsp;</p>
    </aside>
  <!-- end .sidebar1 --></div>
   <article class="content" id="content">
    <section>
      <br><p><h1>Please sign in or register to continue...</h1></p><br>
      <p><form action="authenticate.asp" method=post>
<table border=0 align="center">
<%=ResponseMessage%>
<tr><td><b>
Username: </b></td><td><input name="username" size=16 width=20>
</td></tr><tr><td><b>
Password: </b></td><td><input type="password" name="Password" size=16 width=20>
</td></tr><tr><td></td><td>
<input type="hidden" name="redirect" value="<%=request("redirect")%>">
<input type="hidden" name="SessKey" value="<%=request("SessKey")%>">
<INPUT TYPE="submit" class="buttons" value="Login">
</td></tr></table>
<br>
<p><a href="register.asp">Not registered?.. Click Here</a></p>
<br><br>
    </section>
  <!-- end .content --></article>
  <aside>
    <p><strong></strong></p>
  </aside>
  <!--#include file="css/footer.html"-->
  <!-- end .container --></div>
</body>
</html>

我已经在facebook上注册了一个应用程序,所有配置都正确。

您是否尝试注册这些更改以反映用户成功登录?是的,您将希望实现FB JS-SDK和FB.Event.subscribe和/或呼叫以获取用户的登录状态。您好,请澄清问题状态。。。这个问题已经有将近一年没有答案了,你解决这个问题了吗?