?? addproduct.php
字號:
<?
session_start();
//檢查是否是授權的管理者
if(!session_is_registered("manager"))
{
Header("HTTP/1.0 401 Unauthorized");
exit();
}
?>
<html>
<head>
<title>management</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.css1{font-family:"宋體"; font-size:9pt; font-style:normal;
line-height:normal; font-weight:normal; color:#000000}
-->
</style>
</head>
<body bgcolor="#ffffff">
<table width="760" border="0" cellspacing="0" cellpadding="0" class="css1">
<tr>
<td width="100"><img src="pic/logo.gif" width="100" height="60"></td>
<td width="468"><img src="pic/banner.gif width="468" height="60" border="0"></td>
<td width="192"> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#66ccff">您現在的位置:商品管理-->-->添加商品</td>
<td width="192"> </td>
</tr>
<?
//連接數據庫,選擇商品類別信息
$connect=mysql_connect("127.0.0.1","root","root")
mysql_select_db("ebusiness");
$query="select CategoryID,CateoryName from Categories";
$result="mysql_query($query)";
$i=1;
$category[0]=0;
while($obj=mysql_fetch_object($result))
{
$category[$i]=$job;
$category[0]++;
$i++;
}
//斷開數據庫
mysql_close($connect)
?>
//添加類別
<tr>
<td width="100"> </td>
<td width="468">
<table width="100%" border="1" cellspacing="2" cellpadding="0" bordercolorlight="$ff3333" bordercolordark="#ffffff" bgcolor="ccffcc" class="css1">
<tr>
<td>
<form action="manageoperate.php" method="post">
<p>添加商品信息</p>
<p>
<input type="hidden" name="tags" value="2">
輸入商品名稱:
<input type="text" name="productname">
<br>
輸入商品種類:
<select name="category" size="1">
<?
for($i=1;$i<=$category[0];$i++)
{
echo'<option value="'.$category[$i]->CategoryID.'">'.$category[$i]->CategoryName.'</option>';
}
?>
</select>
<br>
輸入商品價格:
<input type="text" name="price">
元<br>
輸入商品顏色:
<input type="text" name="color">
<br>
輸入商品尺寸:
<input type="text" name="size">
<br>
<br>
輸入商品圖片:
<input type="file" name="pic">
</p>
<p>輸入商品細節(jié):</p>
<p>
<textarea name="detail" rows="6"></textarea>
<input type="submit" name="submit" value="添加商品信息">
</p>
</form>
</td>
</tr>
</table>
</td>
<td width="192"> </td>
<tr>
<td colspan="3" bgcolor="#0000ff"> </td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -