网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 如何检测用户第一次访问我的网站并显示友好信息?
内容
    < %@ LANGUAGE="VBscript" % >
    < %
    RequestName = Request.Form("Name")
    RequestLeaveMeAlone = Request.Form("LeaveMeAlone")
    If RequestName < >"" or RequestLeaveMeAlone < >"" then
    ' 在同一个页面中检查表单变量.
    Response.Cookies("MySiteVisitorName") = RequestName
    Response.Cookies("MySiteVisitorName").Expires = #January 01, 2008#
    Response.Cookies("MySiteLeaveMeAlone") = RequestLeaveMeAlone
    Response.Cookies("MySiteLeaveMeAlone").Expires = #January 01, 2008#
    ' 如果表单变量存在,就创建Cookie,并设置到期时间.
    End if
    VisitorName = request.Cookies("MySiteVisitorName")
    LeaveMeAlone = request.Cookies("MySiteLeaveMeAlone")
    ' 读取Cookie.
    If VisitorName ="" and LeaveMeAlone ="" then
    ' 如果用户机子上不存在该Cookie,就创建一个表单询问相关信息.
    % >
    < html >
    < head >
    <title>随风起舞欢迎你!</title>
    < /head >
    < body bgcolor="#ccffff" text="black" link="navy" vlink="purple" >
    < DIV ALIGN="CENTER" >
    < form action="index.asp" method="POST" >
    < H2 >欢迎光临精彩春风< /H2 >
    您的网上昵称是< input type="text" name="name" > (您可以选择不回答而直接点击"发送"按钮)
    < br >< br >
    < input type="hidden" name="LeaveMeAlone" value="x" >
    < input type="submit" value="发送" >
    < /FORM >
    < /DIV >
    < /body >
    < %
    End if
    If VisitorName < > "" then
    Response.write "欢迎您," & VisitorName & "! 这儿就是您的家!"
    ' 如果Cookie和用户名都已存在,则显示一个欢迎页面.
    End if
    ' 结束其余代码.
    % >
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/25 22:52:20