查看文件: ad_newsadd.php
大小: 3.85 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO news (title, idate, doc, link, fn, homefn, fck, cuid1) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['title'], "text"), GetSQLValueString($_POST['idate'], "text"), GetSQLValueString(nl2br($_POST['doc']), "text"), GetSQLValueString($_POST['link'], "text"), GetSQLValueString($_POST['fn'], "text"), GetSQLValueString($_POST['homefn'], "text"), GetSQLValueString($_POST['fck'], "text"), GetSQLValueString($_SESSION['login_id'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($insertSQL, $BE2) or die(mysql_error()); $write='資料已更新...'; $insertGoTo = $_POST['url']; // header(sprintf("Location: %s", $insertGoTo)); echo "<script>alert('".$write."');location.href='".$_POST['url']."';</script>"; // $insertGoTo = "news.php"; // header(sprintf("Location: %s", $insertGoTo)); } ?> <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table width="100%" align="center"> <tr valign="baseline"> <td colspan="2" align="right" valign="top"> </td> </tr> <tr valign="baseline"> <th align="right" valign="top" nowrap="nowrap" class="font2">是否顯示</th> <td valign="middle"><span class="font3"> <select name="fn" id="fn"> <option value="Y" selected="selected">Y</option> <option value="N">N</option> </select> </span></td> </tr> <tr valign="baseline"> <th align="right" valign="top" nowrap="nowrap"><span class="font2">顯示在主頁</span></th> <td valign="middle" class="font3"><select name="homefn" id="homefn"> <option value="Y">Y</option> <option value="N" selected="selected">N</option> </select></td> </tr> <tr valign="baseline"> <th align="right" valign="top" nowrap="nowrap" class="font2">審核</th> <td valign="middle"><select name="fck" id="fck"> <option value="Y">Y</option> <option value="N" selected="selected">N</option> </select></td> </tr> <tr valign="baseline"> <th align="right" valign="top" nowrap="nowrap"> </th> <td valign="middle" class="font3"> </td> </tr> <tr valign="baseline"> <th width="11%" align="right" valign="top" nowrap="nowrap">主旨/</th> <td width="89%" valign="middle" class="font3"><input type="text" name="title" value="" size="50" /></td> </tr> <tr valign="baseline"> <th align="right" valign="top" nowrap="nowrap">發佈日期/</th> <td valign="middle" class="font3"><input name="idate" type="text" id="idate" value="<? echo date('Y-m-d') ;?>" size="50" /> 例 2016-01-31 <input type="hidden" name="link" value="" size="50" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" size="50" /></td> </tr> <tr valign="baseline"> <th align="right" valign="top" nowrap="nowrap">內容/</th> <td valign="baseline"><textarea name="doc" cols="50" rows="12" id="doc"></textarea></td> </tr> <tr valign="baseline"> <td height="40" align="center" valign="middle" nowrap="nowrap"></td> <td align="center" valign="middle"><input type="submit" value="新增資料" /></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1" /> </form>
保存
取消
返回文件列表