使用PHP和未定义索引错误制作搜索引擎

时间:2019-02-10 22:48:01

标签: php

我的搜索引擎php代码无法正常工作,并显示未定义的索引。即使我没有未定义的索引错误,它也不会在数据库中搜索。

<?php include 'header.php';
include 'netting/baglan.php';
if (isset($_POST['arama'])) {
    $aranan=$_POST['aranan'];
    $slidersor=$db->prepare("SELECT * FROM slider WHERE slider_ad LIKE '%aranan%' order by slider_durum DESC, slider_sira ASC limit 25");
    $slidersor->execute();
    $say=$slidersor->rowCount();
} else {
    $slidersor=$db->prepare("select * from slider order by slider_durum DESC, slider_sira ASC limit 25");
    $slidersor->execute();
}

搜索条形码:

<div class="col-md-12">
            <div class="title_right">
                <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
                    <form action="" method="POST">
                    <div class="input-group">
                            <input type="text" class="form-control" name="aranan" placeholder="Aramak istediklerinizi yazın...">
                            <span class="input-group-btn">
                                <button class="btn btn-default" name="arama" type="submit">Ara!</button>
                            </span>
                        </div>
                    </form>
                </div>
            </div>
        </div>

0 个答案:

没有答案