Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying a script title

Status
Not open for further replies.

wilsonaa

Technical User
Jan 3, 2002
9
0
0
GB
Does anyone know how to display an asp script title in the body of the page.

Thanks,
Andrew
 
Try this script

<%
'Name of this script is &quot;findpathinfo.asp&quot;

PathInfo= Request.ServerVariables(&quot;PATH_INFO&quot;)

'(=&quot;/sql/FindPathInfo.asp&quot;)

'Find position of rightmost &quot;/&quot;:
i=InstrRev(PathInfo,&quot;/&quot;)

PathInfo=mid(PathInfo,i+1)

'Find position of &quot;.&quot;:
i=Instr(PathInfo,&quot;.&quot;)

PathInfo=left(PathInfo,i-1)

Response.write PathInfo

'PathInfo should be=&quot;findpathinfo&quot;
%>


Regards
ojf
 
Thanks for that. The info I need to display is the script title rather than the script name ie between <title> and </title>.

Thanks
Andrew
 
what you put between <title></title> will display at the top of the browser (not in the body of the page). is that what you want? for example, this message's <title> is &quot;Displaying a script title - Tek-Tips - Microsoft Internet Explorer&quot; (if you're using IE, that is)

if you're looking for a header in your page, then you just add it in using standard HTML with whatever font styles etc., such as:

<p class=&quot;header&quot;>This Is My Page Header</p>

Or

<H1>This is Also my Page Header</H1>

is that what you're looking for? if you need more help with that, check out the HTML/CSS forum....

%-)

 
Thanks. e.g. If the page title is <title>Methodology</title> I want to be able to write an asp script such as

<Body>
This page is entitled the <% Response.write ????? %> page

WHen previewing in the browser:-

This page is entitled the Methodology page.

Thanks,
Andrew
 
I don't know any way to capture what is in the <title> tags, but if your title is a variable to begin with, such as:

<title><%= sTitle %></title>


<Body>
This page is entitled the <%= sTitle %> page
 
I have two scripts one for &quot;test.asp&quot; which gets the title and passes it into &quot;makealink.asp&quot; for display. I need to incorporate test.asp into makealink.asp to get the makealink.asp title instead - help:

test.asp

<html>
<title>Mail A Link Example</title>
<body bgcolor=&quot;#FFFFFF&quot;>
<form action=&quot;mailalink.asp&quot; method=&quot;post&quot;>
<br>
<script language=JavaScript>
var title = &quot;<input type='hidden' name='title' value='&quot; + document.title + &quot;'>&quot;
document.write (title)
</script>
<input type=&quot;submit&quot; value=&quot;Mail This Link&quot;>
</form>



</body>
</html>




makealink.asp

<html>
<body bgcolor=&quot;#FFFFFF&quot;>
<title>Mail-A-Link</title>

<% title=trim(request.form(&quot;title&quot;))%>
<b>Subject:</b> <%= title %> <br>
<p>


</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top