PHP implementation scan QR code according to browser type to access different download address, php browser type _php tutorial

Source: Internet
Author: User

PHP implementation scan QR code to access different download addresses based on browser type, PHP browser type


<?php$agent = $_server[' http_user_agent '];p reg_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{//is not sure what system or Pcheader ("Location:". $GLOBALS ["Public_appconfig"] ["app"] [' Android ']. " >

Often see the online two-dimensional code login, ask PHP program how to implement the QR code login?

Home you need to know that the QR code can be translated into some words or characters.
Process:
Generates a random validation string for a user, then generates a QR code that corresponds to the user when the user scans the QR code, and then logs on to the user.

Of course, in the process of attention to confidentiality and security measures.

How to implement scanning QR code, to achieve automatic URL jump?

can automatically access to see your phone installed QR code scanning software function
Most QR code scanning software will automatically jump to the URL, and some will ask you to open it first.

http://www.bkjia.com/PHPjc/894133.html www.bkjia.com true http://www.bkjia.com/PHPjc/894133.html techarticle PHP Implementation scan QR code according to browser type to access different download address, php browser type php$agent = $_server[' http_user_agent '];p reg_match ('/android|iphone/i ', $ Agent, $matches);

  • 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.