1
Function GetUrl()
2
Dim ScriptAddress,M_ItemUrl, M_item
3
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME")) '取得當(dāng)前地址
4
M_ItemUrl = ""
5
6
If (Request.QueryString <> "") Then
7
ScriptAddress = ScriptAddress & "?"
8
For Each M_item In Request.QueryString
9
'如果頁面?zhèn)鬟f參數(shù)是用page變量,那么判斷一下page是否已經(jīng)使用,避免重復(fù)!
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
20
End Function
21
22
23
24
Function Cur_Url() '獲取當(dāng)前頁面URL的函數(shù)
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
34
End Function

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34
