Modify the User-Agent of the browser in php to disguise your browser and operating system _ PHP Tutorial

Source: Internet
Author: User
Modify the User-Agent of the browser in php to disguise your browser and operating system. The method to get HTTP_USER_AGENT is simple, such as the php code: Copy the code as follows :? Phpprint_r ($ _ SERVER );? Copy the code as follows :? Phpprint_r ($ _ SERVER [HTTP_USER_AGENT the method for obtaining HTTP_USER_AGENT is very simple, such as php code:

The code is as follows:


?>


The code is as follows:


?>


Both of them can obtain information such as User-Agents and IP address. it is best to use a regular expression to filter and remove information.

----- User-Agents list -----

Internet Explorer 6
Internet Explorer 7
Internet Explorer 8
Firefox
Chrome
Safari
Netscape
Opera
Maxthon
360SE
OmniWeb

For more information about User-Agents, see useragents. xml.

With the information in this file, any browser or operating system can be disguised.

Use User-Agents:

FireFox: [The User-Agent switcher FireFox extension is recommended]
Enter "about: config" in the address bar and press enter.
Settings: general. useragent. override-> custom UA Information.

Chrome
Add the startup parameter-user-agent = "UA information" to the properties of the startup EXE icon.

Safari
Menu bar-> Edit-> Preferences-> Advanced-> Show Develop menu in menu bar;
Menu bar-> Develop-> User-Agent-> UA Information.

Maxthon
Toolbar-> Tools-> Travel settings Center-> Advanced Options-> custom UA Information.

Opera
Enter "opera: config" in the address bar and press enter.
Settings: 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]

IPhone
Replace the Mozilla/5.0 string of the/System/Library/Frameworks/WebKit. framework/WebKit file with the custom UA Information.

Modify the registry for IE browser settings

Location of the User-Agent in the registry
Under [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionInternet SettingsUser-AgentPost Platform], create a new string value and leave the content blank. the name of the character you want to add in the User-Agent is used as an example. Modify the REG file corresponding to the registry as follows:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionInternet SettingsUser-AgentPost Platform]
"Repeated larokre2" = ""

After modification, restart IE.

The user-agent value of IE. The following is a combination of the following addresses + some default values
HKCUSoftwareMicrosoftWindowsCurrentVersionInternet SettingsUser-AgentPost Platform
HKLMSoftwareMicrosoftWindowsCurrentVersionInternet SettingsUser-AgentPost Platform
HKLMSoftwareMicrosoftWindowsCurrentVersionInternet Settings5.0User-AgentPost Platform

IE8 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 the User-Agent, you can also perform a perfect disguise: operating system, browser, spider, mail client, link check, Analyzer, RSS reader, and other client information.

The pipeline method is very simple, such as the php code: the code is as follows :? Php print_r ($ _ SERVER );? The code is as follows :? Php print_r ($ _ SERVER ['http _ USER_AGENT '...

Related Article

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: info-contact@alibabacloud.com 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.