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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get client-side hostname...Urgent... Please....

Status
Not open for further replies.

choohean

Technical User
Jan 15, 2002
57
MY
I try to do some security function in my asp page to allow only certain computer(by checking the hostname) to acess my page... But I don't know how to get the hostname...

Or do you all got other better suggestion to do that?

Please give me a hand...I need to complete this things very soon!

thanks for your kindness...
 
Sift though the Request.ServerVariables for the IP/DNS

<%@enablesessionstate=&quot;false&quot; language=&quot;javascript&quot;%>
<html>
<head>
<title>Testpage</title>
</head>
<body>
<%
for (var i=1;i<=Request.ServerVariables.Count;i++)
Response.Write(i + ': ' + Request.ServerVariables(i) + '<br /><br />');
%>
</body>
</html>
codestorm
Fire bad. Tree pretty. - Buffy
Hey, I'm operating on a limited mental budget here.
<insert witticism here>
 
Thanks for you help... but what I get is still the server info not client side...

What I try to do is a webpage that can get the hostname of the computer who access the web site and than will do the validation weither the client is allow to acces the site or not!

Please give me some help!
 
Some of the ServerVariables relate to the client, not the server .. hang on and I'll go look up their names .. codestorm
Fire bad. Tree pretty. - Buffy
Hey, I'm operating on a limited mental budget here.
<insert witticism here>
 
<%@enablesessionstate=&quot;false&quot; language=&quot;javascript&quot;%>
<html>
<head>
<title>Testpage</title>
</head>
<body>
<%
Response.Write((Request.ServerVariables(&quot;REMOTE_HOST&quot;).length>0)?Request.ServerVariables(&quot;REMOTE_HOST&quot;):Request.ServerVariables(&quot;REMOTE_ADDR&quot;));
%>
</body>
</html>
codestorm
Fire bad. Tree pretty. - Buffy
Hey, I'm operating on a limited mental budget here.
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top