我正在编写一个搜索引擎,我写了一个带有文本输入和按钮的表单:-
<form class="form-inline my-2 my-lg-0" action="" method="post" name="SearchEngine" enctype="multipart/form-data">
<div class="form-group">
<input class="form-control mr-sm-2" name="searchinput" type="search" placeholder="البحث" aria-label="Search">
</div>
<div class="form-group">
<button class="btn btn-outline-Dark my-2 my-sm-0" type="submit" style="direction:RTL;">إبحث</button>
</div>
</form>
后端 [ php 代码 ]
require_once '..\Config.php';
$searchon = $_POST['searchinput'];
$dbCon = "mysql:host=$host;dbname=$db_name";
$PDOCon = new PDO($dbCon, $username, $password);
$stmt = $PDOCon->prepare("SELECT * FROM items WHERE name='$searchon' OR chemicalcom= '$searchon'");
$stmt->execute();
$rows = $stmt->fetchall();
echo $rows['name'];
问题是什么时候提交一个值到文本中没有回音
蛊毒传说