:::

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>
 


:::

搜尋


書籍目錄

展開 | 闔起

線上使用者

11人線上 (5人在瀏覽線上書籍)

會員: 2

訪客: 9

person100_goo, staff3402_goo,

更多…