473,503 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Requesting URL

Does anyone how to get the url in e.g. http://localhost/dev/a/test.asp?id=1
(so I get test.asp). I've tried <% request.ServerVariables("URL") %> but it
returns /dev/a/test.asp, so far I've also heard to use InstrRev, but I don't
know how to use it....

TIA
Jul 19 '05 #1
3 3506
if strcomp(Request.ServerVariables ("HTTPS"), "ON", 1) = 0
then
sURL = "https://"
else
sURL = "http://"
end if
sURL = sURL & Request.ServerVariables ("SERVER_NAME")
sURL = sURL & Request.ServerVariables ("SCRIPT_NAME")
if len(trim(Request.QueryString)) > 0 then
sURL = sURL & "?" & Request.QueryString
end if

Response.Write sURL
-----Original Message-----
Does anyone how to get the url in e.g. http://localhost/dev/a/test.asp?id=1(so I get test.asp). I've tried <% request.ServerVariables ("URL") %> but itreturns /dev/a/test.asp, so far I've also heard to use InstrRev, but I don'tknow how to use it....

TIA
.

Jul 19 '05 #2
Oops. This answer will not be enough to get the result you want.

I think this will work.
<%
sScript = Request.ServerVariables("SCRIPT_NAME")
aScript = Split(sScript, "/")
sScript = aScript(UBound(aScript))

Response.write sScript
%>

Ray at work

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eb**************@TK2MSFTNGP12.phx.gbl...
<%

For Each x in Request.ServerVariables
Response.Write x & " = " & Request.ServerVariables(x) & "<br>"
Next

%>

Make a page with that code and take a look at the available server
variables.

Ray at work

"David de Jong" <news_jonggoud@@@jonggoud.nl> wrote in message
news:7QL_a.15411$tK5.2006383@zonnet-reader-1...
Does anyone how to get the url in e.g.

http://localhost/dev/a/test.asp?id=1
(so I get test.asp). I've tried <% request.ServerVariables("URL") %> but

it
returns /dev/a/test.asp, so far I've also heard to use InstrRev, but I

don't
know how to use it....

TIA


Jul 19 '05 #3
Thanks, this seems to work, I have to say that I didn;t think of this
solution yet,
David
"Adrian Forbes - MVP" <ad****@xxxnoemailxxx.com> wrote in message
news:0f****************************@phx.gbl...
if strcomp(Request.ServerVariables ("HTTPS"), "ON", 1) = 0
then
sURL = "https://"
else
sURL = "http://"
end if
sURL = sURL & Request.ServerVariables ("SERVER_NAME")
sURL = sURL & Request.ServerVariables ("SCRIPT_NAME")
if len(trim(Request.QueryString)) > 0 then
sURL = sURL & "?" & Request.QueryString
end if

Response.Write sURL
-----Original Message-----
Does anyone how to get the url in e.g.

http://localhost/dev/a/test.asp?id=1
(so I get test.asp). I've tried <% request.ServerVariables

("URL") %> but it
returns /dev/a/test.asp, so far I've also heard to use

InstrRev, but I don't
know how to use it....

TIA
.

Jul 19 '05 #4

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

Similar topics

8
2308
by: Keith Bowes | last post by:
I have a script for requesting HTTP resources and I want it to use HTTP compression (to reduce bandwidth), if possible. What's the best way to do this? I've tried using zlib functions but they...
2
1518
by: DaRemedy | last post by:
Hello people, Just a quick question if you guys wouldn't mind answering or pointing me in the right direction. How would I go about creating something like the 'ScreenCam' thingy on...
5
1699
by: Eric R. | last post by:
I was looking through php.net's help guide and a few other documents that I cam across on the web but I am still having trouble finding the information I am looking for. So I came here... Here...
0
1535
by: Ioannis Demetriades | last post by:
Hi, I am doing a VB.NET application with SQL Server 2000 and I need to implement a database search facility that will normally return lots of records. Those records will then be displayed in a...
1
1227
by: Charles A. Lackman | last post by:
Hello, I have made an aspx web application that is using Forms Authentication. Each unsecure page has a custom user control on it that will allow the visitor to login and enter secure pages. The...
1
2451
by: Glenn M | last post by:
I know how i can use request.userhostaddress to get the requesting ip address. is their any way i can get the requesting clients subnet mask also?
4
1392
by: Tim Mavers | last post by:
I am using HttpWebRequest to request a page from my own site. It works great when the site isn't running under SSL, but it fails when I run I turn on SSL. I am assuming I need to include some...
1
1562
by: Aaron | last post by:
Not sure if this is the best spot to post this question, but I am not going to pay money to ask an installation question.... Anyways I am trying to install C# standard 2003 and it analyzes the...
3
3601
by: timchilds | last post by:
I have the following request URL in an ASPx page: http://crm/custom/fileviewer/default.aspx?NAME I want to be able to parse the requesting URL and pass NAME into a variable. Can anyone give...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.