gio
01-29-2003, 01:53 PM
I need some code in asp that will let me know the visitors incoming IP, security purpose... once the user is on the site I want them to get a warning stating that there IP is being logged for fraud purposes. Can anyone help?
![]() | View Full Version : Incoming IP detector gio 01-29-2003, 01:53 PM I need some code in asp that will let me know the visitors incoming IP, security purpose... once the user is on the site I want them to get a warning stating that there IP is being logged for fraud purposes. Can anyone help? gio 01-29-2003, 02:14 PM it can be java or php as well... SolidJoe 01-29-2003, 02:15 PM If you're using apache, there is code that you can put in that shows the refering ip address. Look it up in the apache manual to show you how. gio 01-29-2003, 02:19 PM win2k server iis gio 01-29-2003, 06:43 PM in case anyone is interested i found the code. Server Variables Sometimes you might want to find out more information on your visitors. We can do this using the server variables.These are environment variables that tell us about the environment that your application is running in. Server variables can tell us everything from what browser the visitor is using, to the visitor's ip address, or the last page the visitor came from. For example I can tell that you are using the Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; .NET CLR 1.0.3705) browser, and the IP (Internet Protocol) address of your internet connection is 209.204.51.146 Server Variables can be called with the following syntax; <% Request.ServerVariables("Variable Name") %> Below are a list of some of the more common server variables and how you use them: this tells us the page the visitor came from <% = Request.ServerVariables("HTTP_REFERER") %> The last page you came from: this is a simple way to display a go back link on a page get a visitors IP address <% =Request.ServerVariables("REMOTE_ADDR")%> Your IP address is: 209.204.51.146 find host name of client <%=Request.ServerVariables("REMOTE_HOST")%> The result: 209.204.51.146 this will return the hostname or IP address of the server : find the server domain name <% =Request.ServerVariables("SERVER_NAME")%> Server domain name is: www.codefixer.com this returns the software running on the server <% Request.ServerVariables("SERVER_SOFTWARE")%> The Server software is:Microsoft-IIS/5.0 display the virtual path to the script or application being executed <% =Request.ServerVariables("SCRIPT_NAME") %> The result: /tutorials/servervariables.asp find out what browsers / Operating System a user has display users browser and opertaing system <% = Request.ServerVariables("HTTP_USER_AGENT") %> Your browser is: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; .NET CLR 1.0.3705) To get a list of all the server variables you can simply run this script. <% for each item in request.servervariables tempvalue=request.servervariables(item) response.write item & "=" & tempvalue & "<br>" next %> rigor 01-29-2003, 07:58 PM did you take into account proxy servers? gio 01-30-2003, 05:03 PM thats a good point, but it's better than not having anything... You will have a better idea of where it came from correct? let me know if you have a better way, i would like to know. I am new at this so I have a lot to learn. Thank you |