码迷,mamicode.com
首页 > Web开发 > 详细

php租房子练习

时间:2016-05-13 10:18:50      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

<?php
//var_dump($_POST["qy"]);
$attr = $_POST["qy"];
$str = implode("‘,‘",$attr);

//$sql = "select * from House where Area in (‘{$str}‘)";
//echo $sql;

?>
<form action="0509test.php" method="post">
<?php
    include("DBDA.php");
    $db = new DBDA();
    $sql = "select distinct Area from housedb";
    $arr = $db->Query($sql);
    //var_dump($arr);
    
    foreach($arr as $v)
    {
        $v[0];
        echo "<input type=‘checkbox‘ class=‘qy‘ value=‘{$v[0]}‘ name=‘qy[]‘ />{$v[0]}";
    }
?>
<br />
<input type="checkbox" id="qy" onclick="CheckAll()" />全选
<br />
<input type="submit" value="查询" />
</form>
</body>
<script type="text/javascript">
function CheckAll()
{
    var qx = document.getElementById("qy").checked;
    
    var ck = document.getElementsByClassName("qy");
    for(var i=0; i<ck.length;i++)
    {
        ck[i].checked = qx;
    }
}
</script>

 

php租房子练习

标签:

原文地址:http://www.cnblogs.com/xingfudehuanyan/p/5486345.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!