|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
<%@ 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 \\\' 结束其余代码. % > 返回类别: 教程 上一教程: ASP的对象结构 下一教程: 如何不用数据源打开数据库 您可以阅读与"如何检测用户第一次访问我的网站并显示友好信息"相关的教程: · 如何用ASP判定你的网站的虚拟物理路径 · 如何使用ASP在自己的网站建立投票机制(二) · 如何使用ASP在自己的网站建立投票机制(一) · 在多行文本框中显示读取信息 · ADO 存取数据库时如何分页显示 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |