随笔-3  评论-26  文章-41  trackbacks-0
 1Function GetUrl() 
 2    Dim ScriptAddress,M_ItemUrl, M_item 
 3    ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME")) '取得当前地址 
 4    M_ItemUrl = "" 
 5
 6    If (Request.QueryString <> ""Then 
 7        ScriptAddress = ScriptAddress & "?" 
 8        For Each M_item In Request.QueryString 
 9            '如果页面传递参数是用page变量,那么判断一下page是否已经使用,避免重复!
10            If InStr("page",M_Item)=0 Then 
11                M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) & "&" 
12            End If
13        Next 
14    end if 
15
16    GetUrl = ScriptAddress & M_ItemUrl 
17    if instr(1,GetUrl,"?",1)<1 then
18        GetUrl=GetUrl&"?"
19    end if
20End Function 
21
22
23
24Function Cur_Url() '获取当前页面URL的函数
25    Dim Domain_Name,Page_Name,Quary_Name
26    Domain_Name = LCase(Request.ServerVariables("HTTP_HOST"))
27    Page_Name = LCase(Request.ServerVariables("Script_Name"))
28    Quary_Name = LCase(Request.ServerVariables("Query_String"))
29    If Quary_Name ="" Then
30        Cur_Url = "http://"&Domain_Name&Page_Name
31    Else
32        Cur_Url = "http://"&Domain_Name&Page_Name&"?"&Quary_Name
33    End If
34End Function
posted on 2008-07-23 13:47 百年 阅读(1848) 评论(0)  编辑  收藏 所属分类: Asp Article

只有注册用户登录后才能发表评论。


网站导航: