PHP to modify the browser's user-agent to disguise your browser and operating system _php skills

Source: Internet
Author: User
The way to get Http_user_agent is simple, like the PHP code:
Copy Code code as follows:

<?php Print_r ($_server);

Copy Code code as follows:

<?php print_r ($_server[' http_user_agent '));

Both of these can get user-agents and IP information, preferably with regular expressions, filtering out the information.

———— –user-agents List ————-

Internet Explorer 6
Internet Explorer 7
Internet Explorer 8

More user-agents information in Useragents.xml

With the information in this file, what kind of browser and operating system can be disguised.

How to use user-agents:

firefox:[recommend using User-agent switcher this Firefox extension]
Address bar type: About:config carriage return
Sets the:general.useragent.override–> custom UA information.

Start exe icon attribute with startup parameter: –user-agent= "UA info".

Menu bar->edit->preferences->advanced->show Develop menu in menu bar;
Menu bar->develop->user-agent->ua information.

Toolbar-> Tools-> Roaming Settings Center-> advanced Options-> Custom UA information.

Address bar type: Opera:config carriage return
Set:user-agent-> Custom ID 0-5
Note: [0 Default 1 Opera 2 Mozilla, opera detectable 3 Internet Explorer, opera detectable 4 Mozilla, opera hidden 5 internet Explorer, Opera hidden]

Replace/system/library/frameworks/webkit.framework/webkit mozilla/5.0 string for this file for custom UA information

IE browser settings need to modify the registry

User-agent location in the registry
[Hkey_local_machinesoftwaremicrosoftwindowscurrentversioninternet settingsuser-agentpost Platform], create a new string value, leave the contents blank, The name is the character you want to add to the user-agent, as an example of "Motorolarokre2″." Modify the registry corresponding to the REG file as follows:
Windows Registry Editor Version 5.00

[Hkey_local_machinesoftwaremicrosoftwindowscurrentversioninternet Settingsuser-agentpost Platform]
"Motorolarokre2″=" "

After the modification, restart IE browser.

IE user-agent value, below is a combination of the following address + some default values
Hkcusoftwaremicrosoftwindowscurrentversioninternet Settingsuser-agentpost Platform
Hklmsoftwaremicrosoftwindowscurrentversioninternet Settingsuser-agentpost Platform
Hklmsoftwaremicrosoftwindowscurrentversioninternet Settings5.0user-agentpost Platform

IE8 's user-agents:

IE8 on Windows Vista (compatible browsing)
mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; trident/4.0)

IE8 on Windows Vista
mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; trident/4.0)

IE8 on Windows 7
mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; trident/4.0)

64-bit IE on 64-bit Windows 7:
mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; trident/4.0)

32-bit IE on 64-bit Windows 7:
mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; trident/4.0)

By modifying User-agent, you can also perfect camouflage: the operating system, browsers, spiders, mail clients, link checking, analyzer, RSS Reader and other client information.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.