如何在微信或QQ內(nèi)打開網(wǎng)站提示用瀏覽器打開

廣告也精彩
如何在微信或QQ內(nèi)打開網(wǎng)站提示用瀏覽器打開

今天分享威信手機QQ打開網(wǎng)址提示瀏覽器打開的代碼,當(dāng)你在手機QQ或手機微信內(nèi)打開一個網(wǎng)址,會發(fā)現(xiàn)有的網(wǎng)站會提示讓你復(fù)制地址到手機瀏覽器里打開,或者彈出一個遮罩提示,反正就是讓你用手機瀏覽器打開這個網(wǎng)站,不能在手機微信或手機QQ內(nèi)打開。

環(huán)境檢測代碼:檢測當(dāng)前環(huán)境是微信還是QQ

<?php
$conf['qqjump']=1;
  if(strpos($_SERVER['HTTP_USER_AGENT'], 'QQ/')||strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')!==false && $conf['qqjump']==1){
	$siteurl='https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
	echo '代碼區(qū)域';
  exit; 
} 
?>

提示html代碼:本域名內(nèi)提示用瀏覽器打開

<html>
<head>
<meta charset="UTF-8">
<title>請使用瀏覽器打開</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="format-detection" content="telephone=no">
<meta content="false" name="twcClient" id="twcClient">
<meta name="aplus-touch" content="1">
<style>
body,html {width:100%;height:100%}
* {margin:0;padding:0}
body {background-color:#fff}
#contens {font-weight:bold;margin:-285px 0px 10px;text-align:center;font-size:18px;margin-bottom:125px;}
.top-bar-guidance {font-size:15px;color:#fff;height:70%;line-height:1.8;padding-left:20px;padding-top:20px;background:url(//gw.alicdn.com/tfs/TB1eSZaNFXXXXb.XXXXXXXXXXXX-750-234.png) center top/contain no-repeat}
.top-bar-guidance .icon-safari {width:25px;height:25px;vertical-align:middle;margin:0 .2em}
</style>
</head>
<body>
<div class="top-bar-guidance">
<p>點擊右上角<img src="http://gw.alicdn.com/tfs/TB1xwiUNpXXXXaIXXXXXXXXXXXX-55-55.png" class="icon-safari"> <span id="openm">Safari打開</span></p>
<p>可以繼續(xù)瀏覽本站哦~</p>
</div>
<div id="contens">
檢測到您正在使用應(yīng)用內(nèi)置瀏覽器<br />
請切換到手機瀏覽器觀看,謝謝!!!<br />
</div>
</html>

把以上代碼放到檢測代碼中代碼區(qū)域位置,再一起放到index.php文件中,例如你用的蘋果CMSV10,就添加到網(wǎng)站根目錄下index.php 文件中的最上方,不要覆蓋。

? 版權(quán)聲明

相關(guān)文章

暫無評論

none
暫無評論...