没事写了一个简单的用户登录代码,也贴出来吧
<!--#include file="inc/cn.asp" -->
<!--#include file="inc/function.asp" -->
<%
myname =Html_encode(Request.Form("myname"))
mypass =Html_encode(Request.Form("mypass"))
If myname="" or mypass="" Then
Response.Write("<script>alert('用户名密码不能为空!');history.back();</script>")
Elseif len(myanme)>15 or len(mypass)>15 Then
Response.Write("<script>alert('用户名密码长度1-15 位');history.back();</script>")
Else
Sql="select * from stu_user where user_id='"&myname&"' and user_pwd='"&mypass&"'"
Call Db_connect()
Set Rs=Conn.execute(Sql)
If Not Rs.eof Then
Session("Uid")=Rs("user_id")
Session("Udj")=Rs("user_dj")
Session("Stuname")=Rs("User_name")
Response.Redirect("iframe.asp")
Else
Response.Write("<script>alert('用户名密码不正确!');history.back();</script>")
End if
End If
%>