代码如下:
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<title>修改商品信息</title>
</head>
<body style="margin:0px 0px 0px 0px;">
<?
if($_REQUEST["P_ID"]!="" )
{
$pid = $_REQUEST["P_ID"];
$conn = mysqli_connect("localhost", "root", "");//1链接数据库服务器
$select = mysqli_select_db("88KengDao_DB" ,$conn); //2选择数据库
$str ="select * from Product_Info where P_ID=".$pid ;
$arr = mysqli_query($conn,"$str"); //删除语句
$result=mysqli_fetch_array($arr);
?>
<form action="product_update_do.php" method="post" enctype="multipart/form-data">
<table border="1" width="100%">
<tr>
<td colspan="2" align="center">
修改商品信息
</td>
</tr>
<tr>
<td><font color="red">*</font>商品名称:</td>
<td><input type="text" name="txt_name" value="<? echo $result["P_Name"]?>"/></td>
</tr>
<tr>
<td><font color="red">*</font>商品图片:</td>
<td><input type="file" name="txt_image" />
</tD>
</tr>
<tr>
<td><font color="red">*</font>价格:</td>
<td><input type="text" name="txt_price" value="<? echo $result["P_Price"]?>"/>
</tD>
</tr>
<tr>
<td>简介:
</td>
<td>
<textarea name="txt_intro" rows="8" cols="30"><? echo $result["P_Intro"] ?></textarea>
<input type="image" name="img1" src='<? echo $result["P_Image"]?>' width="130" height="130"/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="hidden" name="txt_id" value="<? echo $result["P_ID"]?>"/>
<input type="hidden" name="txt_image2" value="<? echo $result["P_Image"]?>" />
<input type="submit" value="保存"/>
</td>
</tr>
</table>
</form>
<?
}
?>
</body>
</html>