2006-4-21 ASP 判断 URL 查询字段, 显示相关内容 by Stabx
作用: 在一个页面里显示不同页面
本文件实现的功能
当 查询为空返回主页
当 dateview.asp?dayview= 显示该条件里的内容, 忽略其他
当 dateview.asp?yearview= 显示该条件里的内容, 忽略其他
当 dateview.asp?monthview= 显示该条件里的内容, 忽略其他
当 dateview.asp?weekview= 显示该条件里的内容, 忽略其他
以上都不是,则显示 dateview.asp?todayview= 的内容
主文件
---/---------------------------------------------------------
<% if isempty(request("dayview")) and isempty(request("yearview")) and isempty(request("monthview")) and isempty(request("weekview")) and isempty(request("todayview")) then
response.Write(errorCidNidAid_)
'判断 ID 是否为空, 为真三秒后返回主页, 为假显示下面的内容
%>
<%elseif request("dayview")=request("dayview") and isempty(request("yearview")) and isempty(request("monthview")) and isempty(request("weekview")) and isempty(request("todayview")) then
'如果查询ID = dayview, 并且 yearview, monthivew, weekview, todayview 为空, 显示下面的内容%>
显示查询日
<%elseif request("yearview")=request("yearview") and isempty(request("dayview")) and isempty(request("monthview")) and isempty(request("weekview")) and isempty(request("todayview")) then
'如果查询ID = yearview, 并且 dayview, monthivew, weekview, todayview 为空, 显示下面的内容%>
显示查询年
<%elseif request("monthview")=request("monthview") and isempty(request("dayview")) and isempty(request("yearview")) and isempty(request("weekview")) and isempty(request("todayview")) then
'如果查询ID = monthview, 并且 dayview, yearview, weekview, todayview 为空, 显示下面的内容%>
显示查询月
<%elseif request("weekvive")=request("weekvive") and isempty(request("dayview")) and isempty(request("yearview")) and isempty(request("monthview")) and isempty(request("todayview")) then
'如果查询ID = weekview , 并且 dayview, yearview, monthview, todayview 为空, 显示下面的内容%>
显示查询星期
<%else '如果不符合以上条件, 显示 "todayview=" %>
显示当前日期
<%end if%>
---/---------------------------------------------------------
/*****************************************************************
* subject : ASP 判断 URL 查询字段, 显示相关内容 by Stabx
*
* author : Stabx<shawl.qiu@gmail.com>
*
* blog : http://blog.csdn.net/btbtd \ http://btbtd.exblog.jp/
*
* blog name : Phoenix.GI - P.GI
*
* date : 2006-4-21
*
\****************************************************************/