모바일 index 열기
본문
모바일로 접속시 /mobile/index.html
이 실행되게 하고싶습니다. 아무리 찾아봐도 안되네요...!
[로케이션방법 말고 그누보드에서 제공하는 모바일로 이동하는방법으로요]
현재 include 폴더를 따로만들어 header.html 을 사용중입니다
헤더상단엔
<?
include_once('./_common.php');
include_once('../common.php');
include_once(G5_LIB_PATH.'/latest.lib.php');
include_once(G5_LIB_PATH.'/outlogin.lib.php');
include_once(G5_LIB_PATH.'/poll.lib.php');
include_once(G5_LIB_PATH.'/visit.lib.php');
include_once(G5_LIB_PATH.'/connect.lib.php');
include_once(G5_LIB_PATH.'/popular.lib.php');
?>
지금 이렇게 적혀있습니다.
답변 2
<?php
$arr_browser = array ("iPhone","iPod","IEMobile","Mobile","lgtelecom","PPC");
for($indexi = 0 ; $indexi < count($arr_browser) ; $indexi++) {
if(strpos($_SERVER['HTTP_USER_AGENT'],$arr_browser[$indexi]) == true){
header("Location: http://이동할주소");
exit;
}
}
?>
<script type="text/javascript" language="JavaScript">
var mobileKeyWords = new Array('iPhone', 'iPod', 'BlackBerry', 'Android',
'Windows CE', 'Windows CE;', 'LG', 'SAMSUNG',
'MOT', 'SonyEricsson', 'Mobile', 'Symbian',
'Opera Mobi', 'Opera Mini', 'IEmobile');
for (var word in mobileKeyWords){
if (navigator.userAgent.match(mobileKeyWords[word]) != null){
window.location.href = "이동할 주소";
break;
}
}
</script>
답변을 작성하시기 전에 로그인 해주세요.