查看文件: editpage.php
大小: 4.02 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")) { $updateSQL = sprintf("UPDATE adpage SET pdoc=%s, plink=%s, pdata=%s , pindex=%s , psignup=%s WHERE pid=%s", GetSQLValueString($_POST['pdoc'], "text"), GetSQLValueString($_POST['plink'], "text"), GetSQLValueString($_POST['pdata'], "text"), GetSQLValueString($_POST['pindex'], "int"), GetSQLValueString($_POST['psignup'], "text"), GetSQLValueString($_POST['pid'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $updateGoTo = $_POST['url']; //header(sprintf("Location: %s", $updateGoTo)); echo "<script>location.href = '".$updateGoTo."';</script>"; } $colname_Rt2 = "-1"; if (isset($_GET['id'])) { $colname_Rt2 = $_GET['id']; } mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT * FROM adpage WHERE pid = %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); ?> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">編輯-分頁連結</h3> </div> <form action="" method="post" name="form1" id="form1"> <table cellspacing="0" class="table table-small-font table-bordered table-striped"> <tr valign="baseline"> <th width="146" align="right" nowrap="nowrap"><span class="font2">廣告分頁說明</span>:</th> <td width="281"><input type="text" name="pdoc" value="<?php echo htmlentities($row_Rt2['pdoc'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right"><span class="font2">廣告分頁連結</span>:</th> <td><input type="text" name="plink" value="<?php echo htmlentities($row_Rt2['plink'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right"><span class="font2">排列序</span>:</th> <td><input name="pindex" type="text" id="pindex" value="<?php echo $row_Rt2['pindex'] ; ?>" size="32" /></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right"><span class="font2">連結報名表</span>:</th> <td><select name="psignup" id="psignup"> <option value="N" <?php if (!(strcmp("N", $row_Rt2['psignup']))) {echo "selected=\"selected\"";} ?>>N</option> <option value="Y" <?php if (!(strcmp("Y", $row_Rt2['psignup']))) {echo "selected=\"selected\"";} ?>>Y</option> <? if($myadmin){?> <? }?> </select></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right"><span class="font2">資料模式</span>:</th> <td><select name="pdata" id="pdate"> <option value="Y" <?php if (!(strcmp("Y", $row_Rt2['pdata']))) {echo "selected=\"selected\"";} ?>>廣告區塊模式</option> <option value="N" <?php if (!(strcmp("N", $row_Rt2['pdata']))) {echo "selected=\"selected\"";} ?>>HTML 文字編輯</option> <? if($myadmin){?> <option value="P" <?php if (!(strcmp("P", $row_Rt2['pdata']))) {echo "selected=\"selected\"";} ?>>php程式</option> <? }?> </select></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td><input type="submit" value="更新記錄" /></td> </tr> </table> <input type="hidden" name="MM_update" value="form1" /> <input type="hidden" name="pid" value="<?php echo $row_Rt2['pid']; ?>" /> <input name="url" type="hidden" id="url" value="<? echo $_SERVER['HTTP_REFERER'];?>" /> </form> <div id="back"><a href="javascript:history.back();"><img src="images/back.gif" alt="回上一頁" title="回上一頁" width="115" height="32" border="0"></a></div> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表