大家好 , 以下為表單內容
表單程式(my.php)
<?
include "db.php";
$myarea =array("","","","","基隆市","台北市","台北縣","桃園縣","新竹市","新竹縣","宜蘭縣","花蓮縣","苗栗縣","台中市","台中縣","彰化縣","南投縣","雲林縣","嘉義市","嘉義縣","台南市","台南縣","高雄市","高雄縣","屏東縣","台東縣","金門縣","連江縣","澎湖縣");
$myduration=array("未知","一年","二年","三年以上");
$str="select * from moditem where mod_id = '".$_REQUEST["mod_id"]."';";
$list =mysql_query($str,$link_ID);
list($mod_id,$mod_area,$mod_duration,$mod_com,$mod_item,$mod_name,$mod_tel,$mod_mail,$mod_address,$mod_content,$mod_date,$mod_fix) = mysql_fetch_row($list);
?>
<td><form id="form2" name="form2" method="post" action="updatemoditem.php">
<table width="480" border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#81affc">
<tr>
<td width="119">服務區域</td>
<td width="351"><select id="mod_area" name="mod_area"><? echo "<option value=".$mod_area.">".$myarea[$mod_area]."</option>";?>
</select></td>
</tr>
<tr>
<td width="119">使用期間</td>
<td width="351"><select id="mod_duration" name="mod_duration"><? echo "<option value=".$mod_duration.">".$myduration[$mod_duration]."</option>";?>
</select></td>
</tr>
<tr>
<td>客戶名稱</td>
<td><input name="mod_com" id="mod_com" size="20" value="<? echo $mod_com ?>"/></td>
</tr>
<tr>
<td>報修產品</td>
<td><label>
<input name="mod_item" type="text" id="mod_item" size="20" value="<? echo $mod_item ?>"/>
(如 : 電腦、螢幕、主機)</label></td>
</tr>
<tr>
<td>聯絡人</td>
<td><input name="mod_name" id="mod_name" size="20" value="<? echo $mod_name ?>"/></td>
</tr>
<tr>
<td>聯絡電話</td>
<td><input name="mod_tel" id="mod_tel" size="20" value="<? echo $mod_tel ?>"/></td>
</tr>
<tr>
<td>E-Mail</td>
<td colspan="3"><input id="mod_mail" size="45" name="mod_mail" value="<? echo $mod_mail ?>"/></td>
</tr>
<tr>
<td>維修地址</td>
<td colspan="3"><input id="mod_address" size="45" name="mod_address" value="<? echo $mod_address ?>"/></td>
</tr>
<tr>
<td>故障描述</td>
<td colspan="3"><textarea id="mod_content" name="mod_content" rows="5" cols="45" ><? echo $mod_content ?></textarea></td>
</tr>
<tr>
<td>維修狀況</td>
<td colspan="3"><label>
<select name="fix_step" id="fix_step">
<option value="待處理" selected="selected">待處理</option>
<option value="完成">完成</option>
<option value="尚未完成">尚未完成</option>
</select>
</label></td>
</tr>
<tr>
<td>維修日期</td>
<td colspan="3"><input id="fix_date" name="fix_date" /></td>
</tr>
<tr>
<td>維修內容</td>
<td colspan="3"><textarea id="fix_content" name="fix_content" rows="5" cols="45" ></textarea></td>
</tr>
<tr>
<td> </td>
<td colspan="3"><label>
<div align="center">
<input type="submit" name="button3" id="button3" value="線上維修填表" />
</div>
</label></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td> </td>
<td><p align="center"> </p></td>
</tr>
</table>
更新表單程式(updatemoditem.php)
>即時新聞-熱門
2008年2月26日星期二
PHPMYSQL的語法-表單更新
发帖者 ALEX 时间: 23:30
标签: PHPMYSQL教學
订阅:
博文评论 (Atom)
0 评论:
发表评论