473,937 Members | 11,769 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IP address question

Hello,

I know I can get a client's IP address with $_SERVER['REMOTE_ADDR'], but
I was wondering if I could use PHP to get any additional information,
such as the client's geographic location (zip code would be preferable),
or even just the zip of the ISP. I have spent a lot of time looking for
a solution, but have only really found links to sites where you can
enter an IP and it will trace the info for you. I need to be able to do
it dynamically so that I can keep stats on where viewers are logging in
from (again, I just need general info, like zip code, I don't need to
pinpoint anybody). I looked at all the PHP vars displayed in phpinfo()
but didn't see anything that I thought I could use. Thanks a lot in
advance.

Marcus
Jun 19 '06 #1
3 1412
Marcus wrote:
I know I can get a client's IP address with $_SERVER['REMOTE_ADDR'],
but I was wondering if I could use PHP to get any additional
information, such as the client's geographic location (zip code would
be preferable), or even just the zip of the ISP.


To get the ISP's/domain registrar's address, you need to use "whois"; search
for "php whois" to get some ready to use scripts.

There are also database solutions, like GeoIP, which provide you with the
country (and sometimes additional geographical data) the IP originates from.
JW
Jun 19 '06 #2
On Mon, 19 Jun 2006 14:23:13 -0500, Marcus wrote:
I know I can get a client's IP address with $_SERVER['REMOTE_ADDR']


That's not necessarily the case. In many cases you're getting the IP of
the last proxy server the client went through.

Geolocation by IP Address:
http://www.linuxjournal.com/article/7856

--
The USA Patriot Act is the most unpatriotic act in American history.
Feingold-Obama '08 - Because the Constitution isn't history,
It's the law.

Jun 19 '06 #3
Marcus wrote:
[...] I have spent a lot of time looking for a solution, but have only
really found links to sites where you can enter an IP and it will trace
the info for you.


You might as well trace that information yourself. Just grab a copy of the
information those services use, and check the IP in your server. Please
have a look over here:

http://www.hostip.info/dl/index.html

--
----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

Un ordenador no es un televisor ni un microondas, es una herramienta
compleja.
Jun 19 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5655
by: VooDoo | last post by:
Hi, Is it possible to have the MAC adress of the client that connect to a php page? I have the IP adress, if it's not possible to have directly is it possible to query the DCHP server and have the MAC back? (it's for an intranet purpose). Any idea or help welcome! Thanks, VooDoo
21
15760
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port 1234, but each instance binds to a different ip address. that is to say: instance #1 binds to 192.168.1.5/port 1234 instance #2 binds to 192.168.1.6/port 1234 instance #3 binds to 192.168.1.7/port 1234
7
21335
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of someone (client) that visits a web site through an anonymous proxy if this person ONLY has JavaScript enabled in their browser? This is NOT a question about PHP, perl, VBScript, Java(.class), or ActiveX. Let us _only_ deal with JavaScript for...
22
2499
by: ypjofficial | last post by:
Hello All, While readling the C and C++ literature i came to know that the OS allocates separate protected memory space for each running program and the program do not interfare into one another's address space. Also the address space allocated for each program is totally relative. Now i want to know that from what address value does the stack starts and the heap actually start? What is at address 0(first address) in a program?
6
2673
by: Al | last post by:
Hi I need to get the IP address of a computer on the network that uses dynamic IP addressing. Is there anyway I get the address but providing the name of the computer? Thanks in advance Al
5
3953
by: Kevin Newman | last post by:
Does anyone know of any application (AJAX or other) that will display the appropriate address for for the selected (or detected) country? If not, does anyone know where I can find a list or database of address formats, so that I can make a collection of xml files (or php and/or javascript classes) that represent the address format for each country, so that I can display the correct form elements for a user's own country? I'd really...
5
8929
by: wright.brandt | last post by:
I am new to programming in C. If my question is not appropriate for this newsgroup I apologize. I Have been tasked with writing a small application to do some back end processing in C and have had little trouble getting most of the app written. What seems to be holding me up is a tricky (at least for me) piece of network address logic. I need to be able to take an ip address and compare it to a subnet represented in the doted and slashed...
7
2141
by: Chris Morley | last post by:
Hi, i have found out as i have developed the database i've ended up with a number of tables that have the same attributes. For instance, my suppliers and customers have the same fields for the address. Would it make more sense to create an additonal table and to reference the addressID in the address table? Some tables like employees have multiple addresses, like home address, next of kin address etc. Now this is more of an issue for...
7
3473
by: Flashbang | last post by:
Hi all again, Thanks for all the replies and help I received from my last question. I do find trying to locate the correct area on the forum to post a question very daunting, as there are so many strange titles to choose from….. C / C++ Java .NET Visual Basic Python PHP Ruby / Rails Perl ASP Coldfusion Javascript / Ajax Flash / Actionscript XML H etc etc Hopefully this will be an ok area?? So here’s my question and the problem. ...
17
2366
by: Ben Bacarisse | last post by:
candide <toto@free.frwrites: These two statements are very different. The first one is just wrong and I am pretty sure you did not mean to suggest that. There is no object in C that is the same as its address. The second one simply depends on a term that is not well-defined. Most people consider the type to be an important part of the notion of
0
10123
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11266
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9845
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8200
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7369
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6272
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4894
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4436
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.