一直不理解这些代码的中它的意义

ziluopao 发布于 2016/03/16 14:54
阅读 622
收藏 0
PHP
<?php

define('APP_ID','shop');
define('BASE_PATH',str_replace('\\','/',dirname(__FILE__)));
if (!@include(dirname(dirname(__FILE__)).'/global.php')) exit('global.php isn\'t exists!');
if (!@include(BASE_PATH.'/control/control.php')) exit('control.php isn\'t exists!');
if (!@include(BASE_CORE_PATH.'/33hao.php')) exit('33hao.php isn\'t exists!');
$wapurl = WAP_SITE_URL;
$agent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($agent,"comFront") || strpos($agent,"iPhone") || strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"Android") || strpos($agent,"Windows CE") || strpos($agent,"SymbianOS")){
global $config;
        if(!empty($config['wap_site_url'])){
            $url = $config['wap_site_url'];
            switch ($_GET['act']){
case 'goods':
 $url .= '/tmpl/product_detail.html?goods_id=' . $_GET['goods_id'];
 break;
case 'store_list':
 $url .= '/shop.html';
 break;
case 'show_store':
 $url .= '/tmpl/product_store.html?store_id=' . $_GET['store_id'];
 break;
}
        } else {
            $header("Location:$wapurl");
        }
        header('Location:' . $url);
        exit();
}
define('APP_SITE_URL',SHOP_SITE_URL);
define('TPL_NAME',TPL_SHOP_NAME);
define('SHOP_RESOURCE_SITE_URL',SHOP_SITE_URL.DS.'resource');
define('SHOP_TEMPLATES_URL',SHOP_SITE_URL.'/templates/'.TPL_NAME);
define('BASE_TPL_PATH',BASE_PATH.'/templates/'.TPL_NAME);


Base::run();

?>

主要是红色部分不理解


加载中
0
kkkio2
kkkio2

http://www.w3school.com.cn/php/func_string_strpos.asp

看下这个函数的用法

主要是判断客户端使用的是什么种类的浏览器

0
我只爱庄宝贝
我只爱庄宝贝

看到 安卓 IOS 什么的 就差不多懂了吧 

返回顶部
顶部