Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - show the url in ASP
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

show the url in ASP

 Post Reply Post Reply
Author
mhanif View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2007
Location: Pakistan
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhanif Quote  Post ReplyReply Direct Link To This Post Topic: show the url in ASP
    Posted: 09 June 2008 at 4:14pm
I would like to know how can i show the URL of the current page, like  if i am at default.asp then on top of my page default.asp should be written.   please tell me the code to show the url.
 
Thank you.
Back to Top
mhanif View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2007
Location: Pakistan
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhanif Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2008 at 5:26pm
ok guys, i got it.
 
i was looking for this.  Request.ServerVariables("SCRIPT_NAME")
 
Thanks,
Back to Top
123Simples View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 July 2007
Location: United Kingdom
Status: Offline
Points: 1192
Post Options Post Options   Thanks (0) Thanks(0)   Quote 123Simples Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2008 at 5:28pm
Come again? Can you explain what you mean my friend?
Are you meaning the Title bar?
Back to Top
mhanif View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2007
Location: Pakistan
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhanif Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2008 at 6:36pm
No, actually i wanted to print the file name of the current page.  like if i am visiting the page default.asp then the default.asp should be printed on the page,
 
so i didnt remember the asp code for that, then i found it on google so my problem is solved,
 
i did it like this.
 
<%
filename = Request.ServerVariables("SCRIPT_NAME")
response.write filename
%>
 
it shows the file name of the page you are visiting.... i hope i explained it properly.
 
anyways, Thanks alot for responding.
Back to Top
Jono View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jono Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2008 at 8:10pm
I normally create a debug.asp page to server, session and application variables. It may be useful to you:
 
<%
Dim strKey, intLoop
%>
<h2>Application Variables</h2>
<p>This section shows the variables applicable to the application.</p>
<table class="RecordSet">
<thead>
 <tr><th>Application Variable</th><th>Variable Type</th><th>Variable Data</th></tr>
</thead>
<tbody>
<%
intLoop = 0
For Each strKey in Application.Contents
 Response.write "<tr class=""row" & intLoop Mod 2 & """><td>" & strKey & "</td><td>" & VarType(Application.Contents(strKey)) & "</td><td>" & Application.Contents(strKey) & "</td></tr>" & vbNewLine
 intLoop = intLoop + 1
next
%>
</tbody>
</table>
 
<h2>Session Variables</h2>
<p>This section shows the variables applicable to the current user within the application.</p>
<table class="RecordSet">
<thead>
 <tr><th>Session Variable</th><th>Variable Type</th><th>Variable Data</th></tr>
</thead>
<tbody>
<%
intLoop = 0
For Each strKey in Session.Contents
 Response.write "<tr class=""row" & intLoop Mod 2 & """><td>" & strKey & "</td><td>" & VarType(Session.Contents(strKey)) & "</td><td>" & Session.Contents(strKey) & "</td></tr>" & vbNewLine
 intLoop = intLoop + 1
next
%>
</tbody>
</table>
 
<h2>Server Variables</h2>
<p>This section shows the Server Variables that are available to the application.</p>
<table class="RecordSet">
<thead>
 <tr><th>Server Variable</th><th>Variable Type</th><th>Variable Data</th></tr>
</thead>
<tbody>
<%
intLoop = 0
For Each strKey in Request.ServerVariables'.Contents
 Response.write "<tr class=""row" & intLoop Mod 2 & """><td>" & strKey & "</td><td>" & VarType(Request.ServerVariables(strKey)) & "</td><td>" & Request.ServerVariables(strKey) & "</td></tr>" & vbNewLine
 intLoop = intLoop + 1
next
%>
</tbody>
</table>
Back to Top
mhanif View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2007
Location: Pakistan
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhanif Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2008 at 9:19pm
Thanks alot, Smile
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.