Jump to content

Browser detection


johnnyk

Recommended Posts

[url=http://php.net/get_browser]get_browser[/url] is an option too.

And yeah, HTTP_REFERER (and HTTP_USER_AGENT too) is [i]very[/i] easy to spoof, but there is no spoof-proof way of getting the user agent. It works in the way that the browser actually sends the information along with the request, and you can modify what it sends quite easily.
Link to comment
https://forums.phpfreaks.com/topic/14138-browser-detection/#findComment-55408
Share on other sites

Like I said, it's as reliable as the browser sending the headers.  When I wrote a C++ crawler, I sent a user agent header that corresponded with my crawler.  It is very easy to spoof, but under what circumstances are you testing this other than javascript?  Sometimes it can actually be better to detect within JavaScript, since JS would have been already downloaded.  Even better, detect with both!
Link to comment
https://forums.phpfreaks.com/topic/14138-browser-detection/#findComment-55661
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.