没有合适的资源?快使用搜索试试~ 我知道了~
javascript asp教程第十二课—session对象
0 下载量 105 浏览量
2021-01-02
17:43:44
上传
评论
收藏 42KB PDF 举报
温馨提示
Overview: The Session Object is how you track a single user across many pages. It has four (4) properties, two (2) collections, one (1) method, and two (2) events. Get Started: In this series of examples we will create a password system. We will use the Session Object to track whether or not a us
资源推荐
资源详情
资源评论
javascript asp教程第十二课教程第十二课—session对象对象
Overview:
The Session Object is how you track a single user across many pages. It has four (4) properties, two (2) collections, one (1)
method, and two (2) events.
Get Started:
In this series of examples we will create a password system. We will use the Session Object to track whether or not a user is
authorized to view certain pages. Below are several scripts for lesson12. Look at them, play with, and then read the
explanations that come further down the page.
<%@LANGUAGE=”JavaScript”%>
<%
//No ASP Here, just a regular HTML Page
%>
<HTML>
To play along with our password page, put in a user name and a password.<BR>
<BR>The correct user name is <I>guest</I>.<BR>
And the correct password is also <I>guest</I>.<BR>
<FORM METHOD=”post” ACTION=”script12a.asp”>
User:<INPUT TYPE=”text” SIZE=”9″ NAME=”userName” VALUE=”guest”><BR>
Pass:<INPUT TYPE=”password” SIZE=”9″ NAME=”userPassword” VALUE=”guest”>
<BR>
<INPUT TYPE=”submit” value=”Login”>
</FORM>
</HTML>
Click Here to run script12.asp in a new window. Below is script12a.asp.
<%@LANGUAGE=”JavaScript”%>
<%
var userName=new String(Request.Form(“userName”))
var userPassword=new String(Request.Form(“userPassword”))
if (userName==”guest” && userPassword==”guest”)
{
Session(“Authorized”)=true
Response.Redirect(“script12b.asp”)
}
else
{
Session(“Authorized”)=false
资源评论
weixin_38529486
- 粉丝: 7
- 资源: 942
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功