FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP IP tracking script ?





cyberbuddy
Guys i want a php script which will track the real IP address of my visitors. does any one have any idea of this !!if yes then pls share with me



thank you
badai
just use

$_SERVER['REMOTE_ADDR']

what's a real IP address anyway?
kv
badai wrote:


what's a real IP address anyway?


Probably he means the real address of the machine which is behind a proxy server or anonimizer.
coreymanshack
Well, some machines are actually in a weird network type thing. Like my ISP has one outbound IP address for tons of computers on the internet service, this will never be truly possible if it is at all with php. I can not think of a way to do this with php.
badai
you can.

http://www.amibehindnat.com

but why would you want to do that? if they pissed you of, just sue who ever own that public IP. it's their responsibilities to keep track who use their internal network.
Agent ME
Frihost keeps a log file of users accessing your site, so you can look at the log file to see IP addresses, what page they accessed, and their user-agent.
imagefree
badai wrote:
just use

$_SERVER['REMOTE_ADDR']

what's a real IP address anyway?


$_SERVER['HTTP_X_FORWARDED_FOR']

or extract header x-forwarded. just google it. i dont have enougn time to explain.
Stubru Freak
You can't reliably do that with PHP. $_SERVER['HTTP_X_FORWARDED_FOR'] relies on the proxy to admit they're a proxy. The link badai gave uses Java, not only PHP. The issue for NATs will be fixed with IPv6, the issue for proxies remains, as proxies mask the IP intentionally.
imagefree
Stubru Freak wrote:
You can't reliably do that with PHP. $_SERVER['HTTP_X_FORWARDED_FOR'] relies on the proxy to admit they're a proxy. The link badai gave uses Java, not only PHP. The issue for NATs will be fixed with IPv6, the issue for proxies remains, as proxies mask the IP intentionally.


if proxies are independent (like most are), why not to rely on the ips provided by them.

I forgot to mension that $_SERVER['HTTP_X_FORWARDED_FOR'] may not provide a genuine ip under some cases, for example when the person is coming through more than 1 proxies, this variable shall keep the comma separated list of the ips.

also x-forwarded header is not standard.
Stubru Freak
imagefree wrote:
Stubru Freak wrote:
You can't reliably do that with PHP. $_SERVER['HTTP_X_FORWARDED_FOR'] relies on the proxy to admit they're a proxy. The link badai gave uses Java, not only PHP. The issue for NATs will be fixed with IPv6, the issue for proxies remains, as proxies mask the IP intentionally.


if proxies are independent (like most are), why not to rely on the ips provided by them.

I forgot to mension that $_SERVER['HTTP_X_FORWARDED_FOR'] may not provide a genuine ip under some cases, for example when the person is coming through more than 1 proxies, this variable shall keep the comma separated list of the ips.

also x-forwarded header is not standard.


Well you can rely on it in most of the cases. Of course I don't know why the topic starter needs this, but if it's to track abusers, there's a lot of chance it's an anonymous proxy, so you don't get a correct x-forwarded-for header. My main point was that getting someone's IP can go wrong sometimes. But your solution will work in a lot of cases.
coreymanshack
A good rule of thumb is to block all proxy addresses since most only abusers use proxy to visit you anyway.
Agent ME
I wouldn't rely on $_SERVER['HTTP_X_FORWARDED_FOR'] - A connection could lie and give a different IP, even an IP of another one of the users.
Related topics
PHP IP Ban
Ip Banning Using Php
users online, using php and text file
[php] travel agency script alike
php error ?[parse error]
IP Address Banning ( Not using .htaccess)
my PHP code benchmark script that got some problems
Help with php and java script
Free PHP/MySQL login script
anyone know of a good php form processer script
Simple php & mysql script
Wanting a PHP input security script: up to 1200frih$!
Simple PHP Login Script
PHP - Takasel Membership Script
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.