Php implements QR code scanning to access different download addresses based on browser types, and php browser types

Source: Internet
Author: User

Php implements scanning of QR codes based on browser type access, php browser type

<? Php $ Agent = $ _ SERVER ['HTTP _ USER_AGENT ']; preg_match ('/android | iphone/I ', $ Agent, $ matches ); if (strtolower ($ matches [0]) = 'android') {// echo "android"; header ("Location :". $ GLOBALS ["public_appconfig"] ["app"] ['android']. "'");} elseif (strtolower ($ matches [0]) = 'iphone') {header ("'location :". $ GLOBALS ["public_appconfig"] ["app"] ['ios ']. "'");} else {// you are not sure about the system or pcheader ("Location :". $ GLOBALS ["public_appconfig" ] ["App"] ['android']. "'") ;}?>

I often see the QR code logon on the Internet and ask how to implement the QR code logon in the PHP program?

On the homepage, you must know that the QR code can be translated into some text or characters.
Process:
Generate a Random verification string for a user, and then generate a QR code. When the user scans the QR code, it corresponds to the user and then logs on to the user.

Of course, you should pay attention to confidentiality and security measures in this process.

How Can I scan the QR code to automatically redirect the website?

Automatic access depends on the QR code scanning software installed on your mobile phone.
Most QR code scanning software will automatically Jump when it reads the URL, and some will first ask if you want to open

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.