How much user information is PHP able to collect?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

How much user information is PHP able to collect?

Post by Sindarin »

I know so far that I can get the IP, hostname ,browser name, referrer. Is there any more information I can get using PHP like e.g. screen resolution, exit address etc.?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: How much user information is PHP able to collect?

Post by Eran »

User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Re: How much user information is PHP able to collect?

Post by Sindarin »

So I'll have to get the rest through javascript?

Btw, how can I tell PHP to cut short browser names/version from $_SERVER['HTTP_USER_AGENT']?
for e.g. when someone with Firefox visits the site it will display "Windows, Firefox 2.0 not "Mozilla/5.0(Windows; U; Windows NT 6.0; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20 (.NET CLR 3.5.30729)"
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: How much user information is PHP able to collect?

Post by Eran »

You'll need to parse it yourself, or rely on something like get_browser() - http://www.php.net/get_browser
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Re: How much user information is PHP able to collect?

Post by Sindarin »

ah array values I see, thanks.
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Re: How much user information is PHP able to collect?

Post by Sindarin »

get_browser() works but it seems the browscap.ini is outdated on my host. Isn't a way to parse the information from HTTP_USER_AGENT individually?
Post Reply