zoukankan      html  css  js  c++  java
  • 添加PHP工具栏

    主页面

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    </head>
    <body>

    <form action="getValue.php" method="post">
    标题: <input type="text" name="title" id="title"/> <br/>
    <?php
    include("fckeditor/fckeditor.php") ;
    $oBasePath = $_SERVER['PHP_SELF'];
    $oBasePath = dirname($oBasePath)."/fckeditor/";

    $oFCKeditor = new FCKeditor('FCKeditor1') ;
    $oFCKeditor->BasePath = $oBasePath ;
    $oFCKeditor->Height = "500px";
    // $oFCKeditor->ToolbarSet = "Basic";
    $oFCKeditor->Create() ;
    ?>
    <input type="submit" value="提交" name="submit"/>
    </form>
    </body>
    </html>

    执行

    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <?php
    if(isset($_POST["submit"])){
    $title = $_POST['title'];
    $FCKeditor1= addslashes($_POST["FCKeditor1"]);

    $conn = @mysql_connect("localhost","root","") or die("数据库连接失败,请检查你的网络,稍后再试试");
    mysql_select_db("test");
    mysql_query("set names 'utf8'");

    $sql = "INSERT INTO `test`.`gx` (`id`,`title`,`neirong`) VALUES (NULL, '$title', '$FCKeditor1')";
    mysql_query($sql);

    // $id = mysql_insert_id();
    $sql = "SELECT * FROM `gx`";
    $result = mysql_query($sql);
    }
    while($row = mysql_fetch_array($result)){
    ?>
    标题:<?php echo $row['title']?><br/>
    内容:<?php echo $row['neirong']?><br/>
    <?php
    }
    ?>
    <!--addslashes 单引号 转换-->

  • 相关阅读:
    触发器心得
    心得:上下游企业的各自特点和出路
    MySQL 触发器例子(两张表同步增加和删除)
    JQuery动态隐藏和显示DIV
    MySQL 触发器例子(下订单自动减少库存)
    Step By Step(Lua目录)
    客户端服务端
    C#多线程1
    GFS架构分析
    一个简单的Windows Socket可复用框架
  • 原文地址:https://www.cnblogs.com/ice-ice/p/3751606.html
Copyright © 2011-2022 走看看