首页 > Web开发 > 详细

php租房子练习

时间:2016-05-13 10:16:42      阅读:170      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!