:::

14-2 input.php

<?php
include "setup.php";

if($_POST['op']=="save"){
    $sql = "insert into note (title,content,post_date) values('{$_POST['title']}','{$_POST['content']}',now())";
    mysql_query($sql);
    $sn=mysql_insert_id();
    header("location:view.php?sn=$sn");
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title></title>
 
<link rel="stylesheet" type="text/css" href="dhtmlxSuite/dhtmlxEditor/codebase/skins/dhtmlxeditor_dhx_skyblue.css">
<script src="dhtmlxSuite/dhtmlxEditor/codebase/dhtmlxcommon.js"></script>
<script src="dhtmlxSuite/dhtmlxEditor/codebase/dhtmlxeditor.js"></script>
 
    <style>
        html, body {
            width: 100%;
            height: 100%;
            margin: 0px;
            padding: 0px;
            overflow: hidden;
        }
    </style>
   
    <script>
    var editor;
    function doOnLoad() {
        editor = new dhtmlXEditor("editorObj");
        editor.setIconsPath("dhtmlxSuite/dhtmlxEditor/codebase/imgs/");
        editor.init();
    }
    </script>
  </head>
  <body onload="doOnLoad();">
   
    <form action="input.php" method="post">
        <input type="text" name="title" style="width: 100%;"><br />
        <div id="editorObj" style="height:200px;border:1px solid gray;"></div>      
       
        <textarea id="content" name="content" style="display:none;"></textarea>
        <input type="hidden" name="op" value="save">
        <input type="submit" value="儲存">
    </form>



  </body>
</html>
 


:::

搜尋

QR Code 區塊

https%3A%2F%2Fwww.tad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D9%26tbdsn%3D301

書籍目錄

展開 | 闔起

線上使用者

55人線上 (14人在瀏覽線上書籍)

會員: 0

訪客: 55

更多…