查看文件: edit_footer.php
大小: 1.38 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")) { $filename = $wwwpath."/footer.html"; $str=$_POST['imgtxt']; $file = fopen($filename,"w"); //開啟檔案 fwrite($file,$str); fclose($file); // $updateGoTo = $_POST['url']; // header(sprintf("Location: %s", $updateGoTo)); } $filename = $wwwpath."/footer.html"; $str = ""; //判斷是否有該檔案 if(file_exists($filename)){ $file = fopen($filename, "r"); if($file != NULL){ //當檔案未執行到最後一筆,迴圈繼續執行(fgets一次抓一行) while (!feof($file)) { $str .= fgets($file); } fclose($file); } } ?> <h2>首頁 頁尾</h2> <form action="main.php?act=edit_footer" method="post" name="form1" id="form1"> <table width="100%" align="center"> <tr valign="baseline"> <td valign="top" nowrap="nowrap"> <textarea name="imgtxt" id="imgtxt" rows=30 cols=70 class="ckeditor"><?php echo $str; ?></textarea></td> </tr> <tr valign="baseline"> <td align="center" nowrap="nowrap"><input type="submit" value="更新記錄" /></td> </tr> </table> <input type="hidden" name="MM_update" value="form1" /> <input name="url" type="hidden" id="url" value="<? echo $_SERVER['HTTP_REFERER'];?>" /> </form>
保存
取消
返回文件列表