473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Server Variables

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

Jul 19 '05 #1
3 4750
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" <a@1.net> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #2
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" <a@1.net> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
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



Jul 19 '05 #3
You can do it in client script with: window.document.url

"Aaron" <a@1.net> wrote in message
news:%2*****************@TK2MSFTNGP10.phx.gbl...
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" <a@1.net> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
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


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Grahammer | last post by:
Hi! I have a piece of ASP code that I want to run differently if it is on my development server. Basically, if it's on my server I just want it to do a few response.writes... If it's on...
13
by: Jeager | last post by:
Why is it, Microsoft manage to write operating systems and office applications with every bell and whistle facility known to man. Yet, even after years and years of development they still cannot...
5
by: Phil Grimpo | last post by:
I have a very odd situation here. I have an administration page, where based on a users permissions, a recordset is called from the SQL server which has a list of paths to "Module Menus". Each of...
4
by: Phil Grimpo | last post by:
I had previously explained this problem in a different thread, but now that I have an IISState log, I figured I'd re-start the thred. My situation and the log are following... I have a very odd...
6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
5
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session...
4
by: Bob H | last post by:
Hi, I'm aware of the different ways to pass variables between ASP.Net pages. For pages that need to pass a variable, we're using the server.transfer method. For others, we're using...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
5
by: wolfing1 | last post by:
I'm working on a shopping cart page. In page A (checkout) the user enters their credit card information. On postback, if everything is correct, it sends the user to page B (confirmation). My...
18
by: Thomas Lunsford | last post by:
I have inherited a set of asp pages that I now need to augment. In order to minimize changes to production code, I would like to make a "call" to an asp page from a new asp page. Existing code is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.