杨式段位制套路第二段:谁知道怎么在两页之间怎么传递id值呀?请教asp高手!

来源:百度文库 编辑:高考问答 时间:2024/05/11 05:21:18
这是第一页——
<!--#Include file="conn.asp"-->
<html>
<head>
<title>用户登录</title>
</head>
<body>
<h2 align="center">用户登录</h2>
<center>
<form method="post" action="">
<table border="0" width="90%" bgcolor="#E6E6E6">
<tr>
<td>用户名:</td><td><input type="text" name="name" size="20" >**</td>
</tr>
<tr>
<td>密码:</td><td><input type="password" name="password" size="20">**</td>
</tr><tr>
<td></td><td><input type="submit" value=" 确 定 ">  
<a href="addform.asp">注册</a></td>
</tr>
<table>
</form>
</center>
<%
'如果没有输入姓名,就不执行下列语句
If Trim(Request("name"))<>"" Then
Dim strSql
Set rs=server.CreateObject("ADODB.RecordSet")
strSql ="Select * From users Where user_name='" & Request("name") & "' And user_password='" & Request("password") & "'"
rs.open strsql,conn,1,1
If Not rs.Bof And Not rs.Eof Then
session("id")=rs("user_id")
Response.Write "<a href=msgbox.asp>欢迎光临</a>"
Else
Response.Write "对不起,密码不正确,请重新输入"
End If
End If
%>
</body>
</html>

第二页随便显示几个字就行。
这一页我已经用session定义了,我下一页要怎么写呢?或者用别的方法传递值也行!帮忙写清具体针对这两页怎么写!我这方面很菜,谢谢了!

传递指使用 session
或者用URL中的变量进行传递

登陆成功后,用session("user")用户名来做一下SELECT操作,这样ID不就出来了。

存入application中就可以了