查看文件: homemenu_edit.php
大小: 2.9 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php $colname_Rt2 = "-1"; if (isset($_GET['id'])) { $colname_Rt2 = $_GET['id']; } mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT * FROM mdat WHERE m0 = %s", GetSQLValueString($colname_Rt2, "int")); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE mdat SET m1=%s, m2=%s, m3=%s ,m4=%s WHERE m0=%s", GetSQLValueString($_POST['m1'], "text"), GetSQLValueString($_POST['m2'], "text"), GetSQLValueString($_POST['m3'], "int"), GetSQLValueString($_POST['m4'], "text"), GetSQLValueString($_POST['m0'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $updateGoTo = $_POST['url']; header(sprintf("Location: %s", $updateGoTo)); } ?> <form action="" method="POST" name="form1" id="form1"> <table align="center"> <tr valign="baseline"> <td colspan="2" align="right" nowrap="nowrap"></td> </tr> <tr valign="baseline"> <td width="76" align="right" nowrap="nowrap"><span class="font2">選單名稱</span>:</td> <td width="308"><input type="text" name="m1" value="<?php echo $row_Rt2['m1']; ?>" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"><span class="font2">選單連結</span>:</td> <td><input type="text" name="m2" value="<?php echo $row_Rt2['m2']; ?>" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">使用:</td> <td><label for="m4"></label> <select name="m4" id="m4"> <option value="Y" <?php if (!(strcmp("Y", $row_Rt2['m4']))) {echo "selected=\"selected\"";} ?>>Y</option> <option value="N" <?php if (!(strcmp("N", $row_Rt2['m4']))) {echo "selected=\"selected\"";} ?>>N</option> </select></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"><span class="font2">排列序</span>:</td> <td><input type="text" name="m3" value="<?php echo $row_Rt2['m3']; ?>" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"><input name="m0" type="hidden" id="m0" value="<?php echo $row_Rt2['m0']; ?>" /> <input name="url" type="hidden" id="url" value="<? echo $_SERVER['HTTP_REFERER'];?>" /></td> <td><input type="submit" value="更新記錄" /></td> </tr> </table> <input type="hidden" name="MM_update" value="form1" /> </form> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表