Message search design

1, add a new search button in the message board

<?php
<div>搜索:<input id="con" name="sousuo"><input id="sousuo" type="button" value="确定"></div>

Add new js code:

<?php
$("#sousuo").click(function () {
    str="";
    var con=$("#con").val();
    $.get("messageshowdb.php?content=sousuo",{con:con,page:page,num:num},function (data) {
        $.each(data, function(key,value) {
            str+="<div>"+[key]+":"+"标题:"+value.title+"-----"+"内容:"+value.content+"</div>";
            $("#div1").html(str);
        });
    },"json")
    showpage();
})

2, modify the messageshowbd.php file:

Add the following code:

微信图片_20180308112333.png

3. Effect display:

gif5新文件 (20).gif

Continuing Learning
||
<?php echo "搜索页面设计";
submitReset Code