Is it possible to find and store the IP address information of anyone that visits your site?

I know there are sites and images that show your IP Address, browser, OS, possible location, etc. Could you have some way of writing this found information into a database, or would that be too much of a security flaw? I'm not talking about tracert commands, IP locators, etc. EDIT: Sorry if i wasn't clear enough for anyone, I was meaning something like a PHP, HTML or Java code that logs the visitors IP Address (And if possible, some other miscellaneous information) on a .txt file or something similar.

sort by: active | newest | oldest
lemonie8 years ago
You may be able to get log files written of page requests. Check your web hosting package? L
iTraceur (author)  lemonie8 years ago
Should've thought of that, but sorry, nothing there...
You read something like this?

Z1ggy8 years ago
This will tell you most of the info you want.

<b>You are browsing this site with:</b>
<b>Your IP address is:</b>
<b>The DNS lookup of the IP address is:</b>
<b>The method used to call the page:</b>
<b>The server's domain name:</b>
<b>The server's port:</b>
<b>The server's software:</b>
iTraceur (author)  Z1ggy8 years ago
Erm, I'm probably doing something incredibly wrong, but in a html file, it turns out like this: "You are browsing this site with: Your IP address is: The DNS lookup of the IP address is: The method used to call the page: The server's domain name: The server's port: The server's software:" I may not have clarified, I meant something that automatically writes the visitors IP Address into a file.
Z1ggy iTraceur8 years ago
Im sorry i should have specified. instead of a .html(.htm), the file should be a .aspx. THis will get you the information.

Its easy enough to add a function on pageload that sends this information to a database.

The below is in visual basic. It gets the IP address and stores it in a string, which you can use in calling a stored procedure.

Dim UserIPAddress As String

UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserIPAddress = "" Then
UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
End If
oddmidge8 years ago
A vaguely remember a while ago there was PHP code to store data such as IP and that. I can't remember where it was, but i can tell you it is definitely possible and does exist, keep looking.
iTraceur (author)  oddmidge8 years ago
Great, thanks, thats exactly what i wanted! If you remember anything about it, please tell me!
Well, I don't know if this is a IP locator, but if you could somehow embed this, it could work. It does, afterall tell you all that info....
iTraceur (author)  thermoelectric8 years ago
Yeah, this is what I didn't want. Oh well.

I meant something like a PHP, HTML, or Java code that writes a visitors IP address to a file.

Sorry if I wasn't clear enough on that...