查看文件: welcome_add.php
大小: 2.75 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php if ($_SERVER['REMOTE_ADDR']<>'220.130.43.118'){ exit; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO ad_menu (id, act, act_title, link, link_title, ind, inds) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['id'], "int"), GetSQLValueString($_POST['act'], "text"), GetSQLValueString($_POST['act_title'], "text"), GetSQLValueString($_POST['link'], "text"), GetSQLValueString($_POST['link_title'], "text"), GetSQLValueString($_POST['ind'], "int"), GetSQLValueString($_POST['inds'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($insertSQL, $BE2) or die(mysql_error()); $insertGoTo = "main.php?act=welcome"; // header(sprintf("Location: %s", $insertGoTo)); $msg='更新完成....' ; echo "<script>alert('".$msg."');location.href='".$insertGoTo."';</script>"; } mysql_select_db($database_BE2, $BE2); $query_Rt2 = "SELECT * FROM ad_menu"; $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); ?> <form action="<?php echo $editFormAction; ?>" method="POST" name="form1" id="form1"> <table width="701" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="133"><h3>主標題</h3></td> <td width="123"><h3>連結</h3></td> <td width="142"><h3>子項目標題</h3></td> <td width="116"><h3>連結</h3></td> <td width="124"><h3>項目排序</h3></td> <td width="63"><h3>排序</h3></td> </tr> <tr> <td height="40"><input name="act_title" type="text" id="act_title" size="15" /></td> <td><input name="act" type="text" id="act" size="15" /></td> <td><input name="link_title" type="text" id="link_title" size="15" /></td> <td><input name="link" type="text" id="link" size="15" /></td> <td><input name="inds" type="text" id="inds" value="9999" size="3" /></td> <td><input name="ind" type="text" id="ind" value="0" size="3" /> <input name="id" type="hidden" id="id" /></td> </tr> <tr> <td height="40"> </td> <td> </td> <td> </td> <td colspan="3"><input type="submit" name="button" id="button" value="新增資料" /></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1" /> </form> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表