To make my site secure, i would like to track the ip address of my members to my transaction page. Is there any possible ways of achieving this?

I came across many Javascript IP Address display, however they do not actually track or save the ip addresses.

Recommended Answers

All 10 Replies

the request object has all the information you need about the client. The only problem you would have with ip addresses is if you are behind ISA2000 (not the 2004) or they are behind some proxy.

How will it make your site secure? Are you going to log all ips against a person? I have over 50 class A ip addresses and i also have some dynamic class c ones.. are you going to log all of them? how? why? What does it achieve? There are times when you do need to track an ip but it is for auditing usually and sometimes it is necessary when only allowing one login at a time (but then you get into the realms of having to know when i crashed or timed out and now have a new ip).

Tell us what you are trying to achieve and we will give you the correct solution instead :) as i dont think this will suit your purpose

f1fan: i would appreciate if you can speak in layman terms. None of the postings are useful if i can't understand what you are talking about.

Tracking IP is suppose to be an additional security against fraud transactions. I am not asking for a complicated proof free assistance. I am not a programme pro as i mentioned to you before.

1. This is a TECHNICAL forum so excuse me for speaking in non laymans terms
2. From all of your posts it is obvious that you have no idea about programming/websites/security etc. Whilst i appreciate we all have to start somewhere it is also becoming apparant that this site you are building is destined for a real life commercial website which scares me. To think that you are messing with other peoples money, credit card information and such is frightening. Your site will be hacked in under 30 seconds and peoples information could possibly be at risk. I sincerely hope that you have a vast amount of liability insurance as you will need it.

Precisely its a technical assistance forum that if one knows anything, to direct with codes and assistance. What assistance you are providing are just blunt words with no clear directions.

I am not going to get myself into a ridiculous argument with you. I am working on a school project which is NOT destined for commercial uses, as for improvements, there's always something new to it, being a newbie. Unfortunately, since you are so fanastic about yourself, and i am not on your level, i would appreciate you do not respond to my request for assistance. Thank you

Please read the forum guidelines at this link
http://www.daniweb.com/techtalkforums/announcement61-2.html

I gave help and advice without doing the coding for you as i expected you to be able to at least look up what i had mentioned. I had on a few occassions written the code for you also. I cannot accurately gauge your level of understanding so all you had to do was ask for amplification of something instead of complaining about my answers. I have been programming for 27years and am still learning. So i dont think of myself as fantastic. I try and help those who help themselves but either you have been assigned a project that is way beyond what you have been taught - in which case i would raise it with your instructor, or you have chosen a project which is way beyond what you have been taught. In which case i would have to ask why.

But as you have requested, i have removed myself from this thread and wont answer any more of your questions. Good luck with your project

ok guys, lets stop all that.
we all here want to help each other.

"naster" i understood and if i'm wrong plz correct me.
u want to write all the ips logged into ur system in ur database. why is that?

to do that, as our friend above-said, "request and response" objects.
they are opposite, when u use response object, u ask the server for something and when u use request object, u r takign information from the user side.

google it and read about it. it will help u

sam

I got similar problem, that i tried both "request and response objects" but none return the client Ip, but IP of the server. This is just within LAN with about 15 to 25 client machines, with ISA Server. This is just for redirecting user with IP reservations. Is the ISA firewall and proxy got something to do with the prob? Thanks in advance

Hi,

I'm not sure what the C# equivalent of this is, but it's probably not too much different (drop the dim, set the string setting in front):

Dim strX as STring
strX = Request.UserHostAddress()
Response.Write(strX)

Obviously, you can substitute the variable name with whatever you want. Also, you don't have to Response.Write it, in fact you probably (99%) won't want to, that was just an example of using the variable.

IF that doesn't work for you, you can also do the following:

Context.Request.ServerVariables["REMOTE_ADDR"]

now, if that might also give you the user's ISP's IP, so it'll get tricky, and you'll want to do the following:

Dim strX as string;
strX = Request.ServerVariables("HTTP_X_FOWARDED_FOR");
if(strX==string.Empty)
{
strX=Request.ServerVariables("REMOTE_ADDR");
}

however, that returns the proxy ip, and never the client ip address.

Like my problem, running webserver behind (ISA) Proxy, thus the code always returns the Server IP. Even in local area network only, where I am currently stuck :(

// Getting ip of visitor
string ip = Request.ServerVariables["REMOTE_ADDR"];
// Getting the page which called the script
string page = Request.ServerVariables["HTTP_REFERER"];
// Getting Browser Name of Visitor
if (Request.ServerVariables["HTTP_USER_AGENT"].Contains("MSIE"))
  browser = "Internet Explorer";
if (Request.ServerVariables["HTTP_USER_AGENT"].Contains("FireFox"))
  browser = "Fire Fox";
if (Request.ServerVariables["HTTP_USER_AGENT"].Contains("Opera"))
  browser = "Opera";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.