<%@ Language="VBScript" %> <!DOCTYPE html> <html> <head> <title>会员管理系统</title> </head> <body> <h1>会员管理系统</h1> <% Dim conn, rs, sql, action, username, password, email, phone, address Set conn = Server.CreateObject("ADODB.Connection") conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("members.mdb") action = Request.Form("action") username = Request.Form("username") password = Request.Form("password") email = Request.Form("email") phone = Request.Form("phone") address = Request.Form("address") If action = "register" Then sql = "INSERT INTO members (username, password, email, phone, address) VALUES ('" & username & "', '" & password & "', '" & email & "', '" & phone & "', '" & address & "')" conn.Execute sql Response.Write "注册成功!" ElseIf action = "login" Then sql = "SELECT * FROM members WHERE username='" & username & "' AND password='" & password & "'" Set rs = conn.Execute(sql) If Not rs.EOF Then Session("username") = username Response.Redirect "profile.asp" Else Response.Write "用户名或密码错误!" End If ElseIf action = "update" Then sql = "UPDATE members SET email='" & email & "', phone='" & phone & "', address='" & address & "' WHERE username='" & username & "'" conn.Execute sql Response.Write "更新成功!" ElseIf action = "view" Then sql = "SELECT * FROM members WHERE username='" & username & "'" Set rs = conn.Execute(sql) If Not rs.EOF Then Response.Write "用户名:" & rs("username") & "<br>" Response.Write "邮箱:" & rs("email") & "<br>" Response.Write "电话:" & rs("phone") & "<br>" Response.Write "地址:" & rs("address") & "<br>" Else Response.Write "未找到该用户!" End If End If conn.Close Set conn = Nothing %> <form method="post"> <input type="hidden" name="action" value="<%=action%>"> <input type="hidden" name="username" value="<%=username%>"> <input type="hidden" name="password" value="<%=password%>"> <input type="hidden" name="email" value="<%=email%>"> <input type="hidden" name="phone" value="<%=phone%>"> <input type="hidden" name="address" value="<%=address%>"> </form> </body> </html>
在这个示例中,我们使用了Microsoft Access数据库(通过Jet引擎)来存储会员信息,你需要创建一个名为members.mdb
的数据库文件,并在其中创建一个名为members
的表,包含以下字段:username
(用户名)、password
(密码)、email
(邮箱)、phone
(电话)和address
(地址)。
你还需要创建两个ASP页面:一个用于显示注册表单(例如register.asp
),另一个用于显示用户个人资料(例如profile.asp
),这两个页面应该分别包含适当的表单和逻辑来处理用户的注册和登录操作。
各位小伙伴们,我刚刚为大家分享了有关“会员管理asp源码”的知识,希望对你们有所帮助。如果您还有其他相关问题需要解决,欢迎随时提出哦!
原创文章,作者:未希,如若转载,请注明出处:https://www.kdun.com/ask/1120609.html
本网站发布或转载的文章及图片均来自网络,其原创性以及文中表达的观点和判断不代表本网站。如有问题,请联系客服处理。
发表回复