Welcome to WebmasterWorld Guest from 126.96.36.199
I would like to track the IP address Public or Private one.
Because in the website one Person should register from one IP address only.
Suppose the person is registering from the Private(Browsing centers or from any other LAN),There is the chance to any other person to register from the same IP address so at that time registration will be denied for the user who have not already registered because of the IP locate at Private one.
So the IP address should be tracked Public or Private one.
In that case, you can most likely only count on having *some* public IP. It might be the one the user actually uses on the internet, it might be a proxy on the web. If the user has a proxy on his LAN to connect to the internet, said proxy might (but doesn't have to!) share the local IP of the client requesting the page.
If he uses NAT to connect to the web, you're out of luck, there's no way of telling which client instructed the router to connect to your server.
I understand it janharders,after breaking my head i found something
The IP address between these ranges are private one(browsing ceneters,Organisations etc).
The following ones are Private one.
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
Except all of the above Public ones.
In PHP we can get the IP address by
echo "IP address".$_SERVER["REMOTE_ADDR"]
echo "LAN Address".$_SERVER["HTTP_X_FORWARDED_FOR"]
This Will Show the Output in the following manner
IP address 188.8.131.52
If the IP address is between the above mentioned Classes it will be Private one otherwise it is Public One.
I didn't know this is reliable one or not.
Can you pls tell me.
I would be very cautious with the way you're heading - the IP address (even a combination of the REMOTE_ADDR and HTTP_X_FORWARDED_FOR variables) will not uniquely identify anyone.
Many ISPs allocate dynamic IP addresses, so a users IP address changes every time they reset their router or dial in. Their old IP is then allocated to another user on the same ISP.
Also many private networks use DHCP so the IP address of a device on the internal network can change every time its started up.
Finally, many ISPs won't forward the HTTP_X_FORWARDED_FOR variable.
I think you're better using a simple username and password combination, and maybe only letting users use their e-mail address once?