Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Server Variables

Reply
Thread Tools

Server Variables

 
 
Aaron
Guest
Posts: n/a
 
      10-23-2003
Is there a server var that will give me the entire URL that is in the
address bar? Currently, I am just adding SERVER_NAME & URL

 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      10-23-2003
Something like this - the long and drawn out method

<%
Dim sProtocol, sDomain, sPath, sQuerystring
sResult

'get protocol
sProtocol = "http://"
If UCase(Request.ServerVariabes("HTTPS")) = "ON" Then sProtocol = "https://"

'get domain
sDomain = LCase(Request.ServerVariables("SERVER_NAME"))

'Get path
sPath = LCase(Request.ServerVariables("SCRIPT_NAME"))

'Get querystring
sQuerystring = LCase(Request.Querystring)


''put together
sResult = sProtocol & sDomain & sPath
If Len(sQuerystring) > 0 Then sResult = sResult & "?" & sQuerystring

Ray at work



"Aaron" <> wrote in message
news:...
> Is there a server var that will give me the entire URL that is in the
> address bar? Currently, I am just adding SERVER_NAME & URL
>



 
Reply With Quote
 
 
 
 
Aaron
Guest
Posts: n/a
 
      10-23-2003
Yes, that is pert-near what I have ... for some reason I thought there
was a SRVR_VAR that grabbed the entire value of the address bar ... only
JS perhaps. Thanks!

Ray at <%=sLocation%> wrote:

> Something like this - the long and drawn out method
>
> <%
> Dim sProtocol, sDomain, sPath, sQuerystring
> sResult
>
> 'get protocol
> sProtocol = "http://"
> If UCase(Request.ServerVariabes("HTTPS")) = "ON" Then sProtocol = "https://"
>
> 'get domain
> sDomain = LCase(Request.ServerVariables("SERVER_NAME"))
>
> 'Get path
> sPath = LCase(Request.ServerVariables("SCRIPT_NAME"))
>
> 'Get querystring
> sQuerystring = LCase(Request.Querystring)
>
>
> ''put together
> sResult = sProtocol & sDomain & sPath
> If Len(sQuerystring) > 0 Then sResult = sResult & "?" & sQuerystring
>
> Ray at work
>
>
>
> "Aaron" <> wrote in message
> news:...
>
>>Is there a server var that will give me the entire URL that is in the
>>address bar? Currently, I am just adding SERVER_NAME & URL
>>

>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
Session Variables and Static Variables cobus.lombard@gmail.com ASP .Net 1 03-26-2006 11:05 AM
Server to server = Server client to server? - Java 2 07-29-2005 10:46 PM
Accessing class member variables - properties or variables? dwok Java 7 03-04-2005 03:54 AM
Re: Class public shared Variables vs. Application Variables in ASP.NET avnrao ASP .Net 0 05-07-2004 05:28 AM



Advertisments