zoukankan      html  css  js  c++  java
  • 做一个php登陆页面,用pc登陆和用手机登陆弹出来的登陆页面不一样。

    <?php
    header('Content-Type:text/html; charset=UTF-8');//定义页面编码为utf8
    $is_pc = (strpos($agent, 'windows nt')) ? true : false;//是否是pc电脑端
    $is_mobi = (strpos($agent, 'Mobile')) ? true : false;//是否是移动端
    $is_iphone = (strpos($agent, 'iphone')) ? true : false; //是否是iphone
    $is_ipad = (strpos($agent, 'ipad'))?true:false;//是否是ipad
    $is_android = (strpos($agent, 'android')) ? true : false;//是否是安卓
    //自我感觉php的header("Locaion:")跳转页面比html的<meta>跳转要好用,兼容的浏览器多,我曾用<meta>自动跳转页面,浏览器就是不动,最后改成header就好了
    if($is_pc){
    header("Location:dhu_login_pc.php");
    exit;
    //这里跳转到电脑页面,最好先判断
    }if($is_iphone){
    header("Location:dhu_login_mobile.php");//这里跳转到iphone页面
    exit;
    }elseif($is_ipad){
    header("Location:dhu_login_mobile.php");//这里跳转到ipad版页面
    exit;
    }if($is_android){
    header("Location:dhu_login_mobile.php");//这里网址跳转到安卓版页面
    exit;
    }else{
    header("Location:dhu_login_mobile.php")//最后跳转的页面最好设置为低端手机端的页面,或者非html5等耗流量页面,判断到最后,可以知道用了代理或者真的手机非高端

    exit;
    }
    ?>
    另:
    header("Location:dhu_login_pc.php");实现的功能是跳转的dhu_login_pc.php页面,时间间隔0秒,使用它时,前面不能有输出,使用后要紧接着exit;
  • 相关阅读:
    2017 ICPC beijing E
    1629 B君的圆锥
    1298 圆与三角形
    通过String获取字符数组
    Java中的代码点与代码单元
    数据库事务隔离级别
    oracle修改密码、添加用户及授权
    Python起航
    软件测试常见概念
    TestNG--@Factory
  • 原文地址:https://www.cnblogs.com/u0mo5/p/4168039.html
Copyright © 2011-2022 走看看