查看文件: edittb1.php
大小: 3.06 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $ar1=array("","北","中","南","東","離島"); $updateSQL = sprintf("UPDATE `tb1` SET tbc0=%s, ec4=%s , ec2=%s WHERE ec1=%s", GetSQLValueString($_POST['tbc0'], "int"), GetSQLValueString($_POST['ec4'], "text"), GetSQLValueString($ar1[$_POST['tbc0']], "text"), GetSQLValueString($_POST['ec1'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $updateGoTo =$_POST['url'];// "main.php?act=user"; header(sprintf("Location: %s", $updateGoTo)); } $colname_Rt2 = "-1"; if (isset($_GET['id'])) { $colname_Rt2 = $_GET['id']; } mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT * FROM `tb1` WHERE ec1 = %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); ?> <form action="" method="POST" name="form1" id="form1"> <table width="37%" align="center"> <tr valign="baseline"> <th width="5%" height="33" align="right" valign="top" nowrap="nowrap">地名:</th> <td width="95%" valign="baseline"><input name="ec3" type="text" id="ec3" value="<?php echo $row_Rt2['ec3']; ?>" size="32" readonly="readonly" /></td> </tr> <tr valign="baseline"> <th height="31" align="right" valign="top" nowrap="nowrap">排列序:</th> <td valign="baseline"><input name="ec4" type="text" id="ec4" value="<?php echo $row_Rt2['ec4']; ?>" size="32" /></td> </tr> <tr valign="baseline"> <td height="30" align="center" valign="middle" nowrap="nowrap">區域:</td> <td height="30" align="left" valign="middle" nowrap="nowrap"><label for="tbc0"></label> <select name="tbc0" id="tbc0"> <option value="1" <?php if (!(strcmp("1", $row_Rt2['tbc0']))) {echo 'selected="selected"';} ?>>北</option> <option value="2" <?php if (!(strcmp("2", $row_Rt2['tbc0']))) {echo 'selected="selected"';} ?>>中</option> <option value="3" <?php if (!(strcmp("3", $row_Rt2['tbc0']))) {echo 'selected="selected"';} ?>>南</option> <option value="4" <?php if (!(strcmp("4", $row_Rt2['tbc0']))) {echo 'selected="selected"';} ?>>東</option> <option value="5" <?php if (!(strcmp("5", $row_Rt2['tbc0']))) {echo 'selected="selected"';} ?>>離島</option> </select></td> </tr> <tr valign="baseline"> <td height="40" colspan="2" align="center" valign="middle" nowrap="nowrap"><input type="submit" value="修改資料" /></td> </tr> </table> <input name="ec1" type="hidden" id="ec1" value="<?php echo $row_Rt2['ec1']; ?>" /> <input type="hidden" name="MM_update" value="form1" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" /> </form> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表