<?php
header("Content-type:text/html;charset=utf-8");
$keyword = $_POST["keyword"]; 
if($keyword == "")
{  
echo "<script>alert('bu yao liu kong'); history.go(-1);</script>";  
}  
else{
$con = mysql_connect("localhost","root","jeffreys");
if (!$con)
  {
  die('connect mysql error' . mysql_error());
  }
mysql_query("SET NAMES UTF8");
mysql_select_db("new", $con);
$result = mysql_query("SELECT * FROM `sgk` where name1 = '$_POST[keyword]'");
$num = mysql_num_rows($result); 
if($num)
{


echo "<table border='1'>
<tr>
<th>name</th>
<th>pass</th>
<th>email</th>
<th>site</th>
<th>salt</th>
<th>other</th>
<th>text</th>
</tr>";
    
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['name1'] . "</td>";
echo "<td>" . $row['pass'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['site'] . "</td>";
echo "<td>" . $row['salt'] . "</td>";
echo "<td>" . $row['other'] . "</td>";
echo "<td>" . $row['text'] . "</td>";
echo "</tr>";
}
echo "</table>";
}  
else{
echo "dui bu qi ,cha bu dao";
}

}
?>

