如何检测用户第一次访问我的网站并显示友好信息?

发布时间:2022-04-17 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了如何检测用户第一次访问我的网站并显示友好信息?脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

< %@ LANGUAGE="vbscript" % >
< %
RequestName = Request.Form("Name")
RequestLeaveMeAlone = Request.Form("LeaveMeAlone")
If RequestName <&nbsp; >"" 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
'
结束其余代码.

% >

[1]

脚本宝典总结

以上是脚本宝典为你收集整理的如何检测用户第一次访问我的网站并显示友好信息?全部内容,希望文章能够帮你解决如何检测用户第一次访问我的网站并显示友好信息?所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: