zoukankan      html  css  js  c++  java
  • phpcms 根据条件调取内容

    asdasdsd

    <script>

    正则 截取 function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //һĿʽ var r = window.location.search.substr(1).match(reg); //ƥĿ if (r != null) return unescape(r[2]); return null; //زֵ }
    截取上次点击的get传输的条件

    var style_anli = getUrlParam('style_anli'); var model_anli = getUrlParam('model_anli'); var package = getUrlParam('package'); $(document).ready(function(){ $("#style_anli"+style_anli).addClass("s"); $("#model_anli"+model_anli).addClass("s"); $("#package"+package).addClass("s"); $("#style_anli").val(style_anli); $("#model_anli").val(model_anli); $("#package").val(model_anli); }); 赋值提交 function setProps(objid,value){ $("#"+objid).val(value); $("#qRooms").submit(); } 隐藏的提交表单</script> <form action="/index.php" id="qRooms" method="get"> <input type="hidden" name="m" value="content" id="m"/> <input type="hidden" name="c" value="index" id="c"/> <input type="hidden" name="a" value="lists" id="a"/> <input type="hidden" name="catid" value="{$catid}" id="catid"/> <input type="hidden" name="style_anli" value="" id="style_anli"/> <input type="hidden" name="model_anli" value="" id="model_anli"/> <input type="hidden" name="package" value="" id="package"/> </form>


    <ul class="casStyle">
                                <li><a href="javascript:setProps('style_anli',0);" id="style_anli0">现代简约</a></li> !! setProps('style_anli',0) 赋值提交
                                <li><a href="javascript:setProps('style_anli',1);" id="style_anli1">乡村田园</a></li>
                                <li><a href="javascript:setProps('style_anli',2);" id="style_anli2">地中海</a></li>
    </ul>



    <?php if($_GET['style_anli']!=""){ $style_anli=" and style_anli=".$_GET['style_anli']; } if($_GET['model_anli']!=""){ $model_anli=" and model_anli=".$_GET['model_anli']; } if($_GET['package']!=""){ $package=" and package=".$_GET['package']; } $sql="catid=10 ".$style_anli.$model_anli.$package; $fengge=array('现代简约','乡村田园','地中海','混搭','欧式','中式','北欧','日式'); ?> {pc:content action="lists" catid="$catid" where="$sql" num="1" order="listorder DESC" page="$page" moreinfo="1" } !调取条件where=“”! {loop $data $r}
    ————勇敢的少年啊 快去创造奇迹————
  • 相关阅读:
    2019-12-18
    java读取XML文件,及封装XML字符串
    java不用中间变量交换两个值
    oracle获取当前月的第一个星期五
    2019-10-23
    HTTP中GET请求与POST请求的区别
    Java面试题整理(转载)
    java 字节流与字符流的区别
    20190822
    C++标准库string
  • 原文地址:https://www.cnblogs.com/masterccc/p/4867766.html
Copyright © 2011-2022 走看看