小编And*_*asa的帖子

iOS/Android检测和重定向

js中的新手让我慢一点:D需要根据用户使用的os进行重定向.如果ios重定向到x,如果android重定向到y,else..stay在原始地址上.我的问题:

这些片段足够吗?

<script type="text/javascript"> // <![CDATA[
    if ( (navigator.userAgent.indexOf('Android') != -1) ) {
        document.location = "y";
    } // ]]>
</script>

<script type="text/javascript"> // <![CDATA[
    if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1)) {
        document.location = "x";
    } // ]]>
</script>
Run Code Online (Sandbox Code Playgroud)

谢谢!:D

javascript redirect operating-system

4
推荐指数
1
解决办法
2万
查看次数

Wpdb更新通过$ wpdb-> query()无效

我正在尝试制作一个wordpress插件,我遇到了一个问题.

问题是更新查询,我无法弄清楚它为什么不起作用.查询应更新非wordpress表

global $wpdb;
$sql ="UPDATE $lmdisp_table_name
            SET `".$lmdisp_nume."`=".$nume.",
                `".$lmdisp_departament."` = ".$dep.",
                `".$lmdisp_an."` = ".$an.",
                `".$lmdisp_grupaserie."` = ".$grupa.",
                `".$lmdisp_tel."` = ".$tel."' ,
                `".$lmdisp_email."` = ".$email.",
                `".$lmdisp_fb."` = ".$fb.",
                `".$lmdisp_tw."` = ".$tw.",
                `".$lmdisp_linked."` = ".$linked.",
                `".$lmdisp_freel."` = ".$freel.",
                `".$lmdisp_blog."` = ".$blog.",
                `".$lmdisp_memyear."` = ".$memyear.",
                `".$lmdisp_fctlse."` = ".$fct.",
                `".$lmdisp_evlse."` = ".$evlse.",
                `".$lmdisp_skills."` = ".$skills.",
                `".$lmdisp_avatar."` = ".$avatar.",
                `".$lmdisp_cv."` = ".$cv."
           WHERE  `".$lmdisp_id."` = ".$id."";

    $rez = $wpdb->query($sql);
Run Code Online (Sandbox Code Playgroud)

一点帮助 ?:(

php wordpress plugins wpdb

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

javascript ×1

operating-system ×1

php ×1

plugins ×1

redirect ×1

wordpress ×1

wpdb ×1