php实现扫描二维码根据浏览器类型访问不同下载地址,php浏览器类型_PHP教程

WBOY
Release: 2016-07-13 10:17:15
Original
1077 people have browsed it

php实现扫描二维码根据浏览器类型访问不同下载地址,php浏览器类型

<&#63;php
$Agent = $_SERVER['HTTP_USER_AGENT'];
preg_match('/android|iphone/i',$Agent,$matches);
if (strtolower($matches[0]) == 'android') {
// echo "安卓";
header("Location: ".$GLOBALS["public_appconfig"]["app"]['android']."'");
} elseif (strtolower($matches[0]) == 'iphone') {
header("'Location: ".$GLOBALS["public_appconfig"]["app"]['ios']."'");
}else{
//不确定是什么系统或者是pc
header("Location: ".$GLOBALS["public_appconfig"]["app"]['android']."'");
}
&#63;>
Copy after login

常常看到网上二维码登录,问PHP程序中怎实现二维码登录?

首页你要知道二维码可以翻译成一些文字或者字符。
过程:
对一个用户生成一个随机验证字符串,然后生成二维码,当用户扫描二维码时对应到这个用户,然后登录该用户。

当然,在这个过程中要注意保密和安全措施。
 

怎实现扫描二维码,实现网址自动跳转?

能否自动访问就看你手机安装的二维码扫描软件的功能了
大部分二维码扫描软件读取到网址会自动跳转,有些会先询问你是否打开
 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/894133.htmlTechArticlephp实现扫描二维码根据浏览器类型访问不同下载地址,php浏览器类型 php$Agent = $_SERVER['HTTP_USER_AGENT'];preg_match('/android|iphone/i',$Agent,$matches);i...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!