22-04-23, 08:35 PM
صفحة البحث index.html
صفحة النتائج search.php
كود :
<form action="search.php" method="post">
<input type="text" name="s" value="tyu" />
<input type="submit" name="submit" value="search">
</form>صفحة النتائج search.php
كود :
<table border=1 cellpadding=5 cellspacing=0>
<?php
$s = $_POST["s"];
$conn=mysqli_connect('localhost','root','');
$db=mysqli_select_db($conn,'tadreeb');
$req="select * from employee where name='{$s}'";
$query=mysqli_query($conn,$req);
while ($row = mysqli_fetch_assoc($query))
{
echo "<tr>";
echo "<td name=center>{$row['name']} </td> ,<td telephone=center>{$row['telephone']} </td>";
echo "</tr>";
/*"namess".$row['name']."<br>";*/
}
?>
</table>