<html>
<head>
<meta http-equiv="Content-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>搜尋刪除</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
搜尋主題刪除:<input type="text" name="serch" size="20" style="border: 1px solid #000000;">
<input type="submit" name="Submit_serch" value="送出查詢">
</form>

<?
if($_POST['Submit_serch'] == "送出查詢"){
include("config.php");
$serch = $_POST['serch'];
$sql = "SELECT * FROM ".$db_tablename . " WHERE subject Like '%".$serch."%'";
$sql_result = mysql_query($sql) or die("資料錯誤!!");
while ($row = mysql_fetch_array($sql_result)){
echo "<table border='0' width='50%'>";
echo "<tr>";           
echo "<td style='border-style: dotted; border-width: 1px'>";
echo $row["subject"];
echo "</td>";
echo "<td align='center' width='15%' style='border-style: dotted; border-width: 1px'>";
$temp_id = urlencode($row["subject"]);
echo "<a href=\"delete.php?id=$temp_id\">刪除資料</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
}
}
?>

</body>
</html>

lovean 發表在 痞客邦 PIXNET 留言(0) 人氣()