<%
Response.Write ( "Client IP: " & Request.ServerVariables( "REMOTE_ADDR" ) &
"<BR>\r\n" )
Response.Write ( "Server IP: " & Request.ServerVariables( "LOCAL_ADDR" ) &
"<BR>\r\n" )
%>
This returns the IP of the client browsing the web page as well as the IP of
the interface on the server that handled the request. If you have a Proxy
in between there, the REMOTE_ADDR is going to show the proxy and not the
actual client, which is expected.
While ASP doesn't have any built-in functionality to do a DNS lookup of
arbitrary location, it is easy to extend via ActiveX/COM, which just about
crosses all MS technologies and can leverage it.
--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Lance Clarke" <anonymous.TakeThisOut@discussions.microsoft.com> wrote in message
news:B3B08268-C702-4C51-BB0E-F9132B39D729@microsoft.com...
Maybe it would be easier if I just told you what I'm trying to do.
PHP includes native functions to do both forward and reverse DNS resolution.
The PHP script:
<?
echo gethostbyname('www.somehost.com');
?>
Will output the IP address of the host. And that's what I need, to be able
to retrieve an IP address in real time and display it within an ASP page.
Currently I have a third-party COM object installed that does DNS, but this
seems so much cleaner if I could get it to work. I have considered having
the PHP script store the IP to a cookie then just doing a response.redirect
into the PHP script and the PHP equivalent back out of it, but I can't help
thinking there is a better way.
Thanks for all your help.
>> Stay informed about: PHP Scripts in an ASP Page