Laurent wrote:
I'm searching to find the name of the file in which i execute a
script.
example : i'm into /directory/page.asp
and i d like to know which variable could help me to find the
path of the file on server side.
Here's one JScript way of doing it:
function showServerVariables() {
var v = Request.ServerVariables
e = new Enumerator(v),
a = new Array(),
s = new String()
for (; !e.atEnd(); e.moveNext()) {
s = String(e.item())
if (!/^ALL/.test(s))
a.push(
"<TD><B>" + s + "</B></TD>" +
"<TD>" + split(v(s)) + "</TD>"
)
}
return "<TABLE><TR VALIGN=\"top\">" +
a.join("</TR>\r\n<TR VALIGN=\"top\">") +
"</TR>\r\n</TABLE>"
function split(item) {
item = String(item)
return item.replace(
/([;\n])/g,"$1<BR>"
).replace(
/(,)/g,"$1 "
).replace(
/(&)/g,"&<BR> "
)
}
}
<%=showServerVariables()%>
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.