Du behover inte gora sa mycket jobb....
sida = "http://" + Request.ServerVariables("SERVER_NAME") + Request.ServerVariables("URL") + "?" + Request.ServerVariables("QUERY_STRING")
3 svar · 1 568 visningar · startad av Pace
GetCurrentURL - Hämtar den aktuella sidans URL med querystrings.
Användning:
Response.Write "Denna sidans URL: " & GetCurrentURL()
Kod:
Function GetCurrentURL()
Dim strQueryString
Dim strServerName
Dim strScriptName
Dim strURL
strQueryString = Request.QueryString
strServerName = Request.ServerVariables("SERVER_NAME")
strScriptName = Request.ServerVariables("SCRIPT_NAME")
strURL = "http://" & strServerName & strScriptName
If strQueryString <> "" Then
strURL = strURL & "?" & strQueryString
End If
GetCurrentURL = strURL
End Function
Du behover inte gora sa mycket jobb....
sida = "http://" + Request.ServerVariables("SERVER_NAME") + Request.ServerVariables("URL") + "?" + Request.ServerVariables("QUERY_STRING")
crisse6 skrev:
Du behover inte gora sa mycket jobb....
sida = "http://" + Request.ServerVariables("SERVER_NAME") + Request.ServerVariables("URL") + "?" + Request.ServerVariables("QUERY_STRING")
Smartare att bygga upp sådant med funktioner än att "hårdkoda" det varje gång. :)
Dessutom är det snyggare utan ?-tecken på slutet där det saknas en querystring:
http://www.domän.com/fil.asp
än
http://www.domän.com/fil.asp?