<?php
Header (' content-type:text/html; Charset=utf-8 ');//define page encoding as UTF8
$is _pc = (Strpos ($agent, ' Windows NT '))? Whether the true:false;//is a PC PC-side
$is _mobi = (Strpos ($agent, ' Mobile '))? Whether the true:false;//is a mobile end
$is _iphone = (Strpos ($agent, ' iphone ')? Whether true:false;//is an iphone
$is _ipad = (Strpos ($agent, ' ipad ')? true:false;//is the ipad
$is _android = (Strpos ($agent, ' Android ')? Whether true:false;//is an Android
Self-feeling PHP header ("locaion:") jump page than HTML <meta> jump to use, compatible with more browsers, I have used <meta> auto jump page, the browser is not moving, finally changed to the header is good
if ($is _pc) {
Header ("Location:dhu_login_pc.php");
Exit
Here to jump to the computer page, it is better to first judge
}if ($is _iphone) {
Header ("Location:dhu_login_mobile.php");//Jump to iphone page here
Exit
}elseif ($is _ipad) {
Header ("Location:dhu_login_mobile.php");//jump to the ipad page here
Exit
}if ($is _android) {
Header ("Location:dhu_login_mobile.php");//This URL jumps to the Android page
Exit
}else{
Header ("Location:dhu_login_mobile.php")//The last page should be set to the low end of the mobile page, or non-HTML5, such as consumption of the page, judge to the end, you can know with the agent or real mobile phone non-high-end
Exit
}
?>
Other:
Header ("Location:dhu_login_pc.php"), the implementation of the function is to jump dhu_login_pc.php page, time interval of 0 seconds, when using it, the front can not have output, after use to immediately exit;
Do a PHP landing page, with a PC landing and using the mobile phone landing on the landing page is not the same.