我有这种形式如何提交表单到同一页面,并得到结果显示
<form action="" method="GET" id="formSearch">
<div class="input-group">
<input type="text" class="form-control" id="inputSearch" name="inputSearch"/>
<span id="spanBtnSearch" class="input-group-btn">
<input type="submit" class="btn btn-primary" id="btnSearch" value="Search"/>
</span>
</div>
</form>
我要发送这种形式在同一个页面,我的连接和查询上低于
<?php
$conn = mysqli_connect("localhost:3311","root","root","compared");
$shingpoint = "SELECT * FROM products WHERE store LIKE 'shingpoint' AND title LIKE '%".$_POST['inputSearch']."%'";
$result = mysqli_query($conn,$shingpoint);
?>
而且应该显示结果的结果是这样的
<div class="row" id="divShingpoint">
<h2 class="section-title style2 text-left">Shingpoint</h2>
<div id="divProductThumbnail" class="item col-lg-4 col-md-4 col-sm-4 col-xs-6 col-xxs-12 colums">
<div class="container" id="divInnerContainer">
<?php while ($shingpointrow = mysqli_fetch_assoc($result)) {?>
<div class="product">
<div class="image"><img class="img-responsive" src="<?php echo $shingpointrow['img'] ?>" alt="<?php echo $shingpointrow['title']?>"/></div>
<div class="description"><h4 class="productname"><?php echo substr(trim($shingpointrow['title']),0,20) ?></h4></div>
<div class="price">
<span><?php echo $shingpointrow['price'] ?></span>
<input type="button" class="btn btn-primary btn-sm" value="Details"/>
</div>
</div>
<?php }?>
</div>
</div>
</div>
它确实发送数据,因为页面刷新并且url已启动过期但结果不显示在我想要搜索的标题div。用C inputSearch:
而且我收到此错误
注意:未定义指数\ wamp64 \第3行
什么缺什么我做错了WWW \ compareit.php?或者有任何其他方法来完成任务?