用dreamweaver8做用户注册和登入的页面的过程

用dreamweaver8做用户注册和登入的页面的过程,第1张

你要Asp还是Jsp,如果不用代码比较难说。我还是用代码给你说吧。望谅解
数据库 students 用到的表 User_info
User_info 表的字段:
user_Id,user_Name,passwrod
loginasp 页面代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="/Connections/connectionasp" -->
<!--连接数据库的connectionasp文件包含进来-->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (RequestQueryString("user_Id") <> "") Then
Recordset1__MMColParam = RequestQueryString("user_Id")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd2
Dim Recordset1_numRows
Set Recordset1_cmd = ServerCreateObject ("ADODBCommand")
Recordset1_cmdActiveConnection = MM_connection_STRING
Recordset1_cmdCommandText = "SELECT FROM dboUser_info WHERE user_Id = '"& RequestForm("username") &"'""<!--注意改下你的表,建议不要改,把你的数据库设置成这个样子,不然要改好多地方-->
Set Recordset1 = Recordset1_cmdExecute
Recordset1_numRows = 0
%>
<%
' Validate request to log in to this site
MM_LoginAction = RequestServerVariables("URL")
If RequestQueryString <> "" Then MM_LoginAction = MM_LoginAction + "" + ServerHTMLEncode(RequestQueryString)
MM_valUsername = RequestForm("username")
If MM_valUsername <> "" Then
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd
Dim shenfen
Dim mingzi
MM_fldUserAuthorization = ""
MM_redirectLoginSuccess = "####asp"<!--连接成功转至页面-->
MM_redirectLoginFailed = "loginasp"<!--连接不成功转至页面-->
MM_loginSQL = "SELECT user_Id,passwrod"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM dboUser_info WHERE user_Id = AND passwrod = "
Set MM_rsUser_cmd = ServerCreateObject ("ADODBCommand")
MM_rsUser_cmdActiveConnection = MM_connection_STRING
MM_rsUser_cmdCommandText = MM_loginSQL
MM_rsUser_cmdParametersAppend MM_rsUser_cmdCreateParameter("param1", 200, 1, 10, MM_valUsername) ' adVarChar
MM_rsUser_cmdParametersAppend MM_rsUser_cmdCreateParameter("param2", 200, 1, 20, RequestForm("password")) ' adVarChar
MM_rsUser_cmdPrepared = true
Set MM_rsUser = MM_rsUser_cmdExecute
If Not MM_rsUserEOF Or Not MM_rsUserBOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If MM_valUsername <>"" Then
shenfen = Recordset1FieldsItem("status")Value
mingzi = Recordset1FieldsItem("user_Name")Value
session("shenfen")=shenfen
session("mingzi")=mingzi
End If
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUserFieldsItem(MM_fldUserAuthorization)Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(RequestQueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = RequestQueryString("accessdenied")
End If
MM_rsUserClose
ResponseRedirect(MM_redirectLoginSuccess)
End If
MM_rsUserClose
ResponseRedirect(MM_redirectLoginFailed)
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 10 Transitional//EN" ">

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/10229775.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-06
下一篇 2023-05-06

发表评论

登录后才能评论

评论列表(0条)

保存