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 单引号 转换-->

  • 相关阅读:
    pipeline+sonar
    ThinkPHP 3.2.3 使用 PHPExcel 处理 Excel 表格
    mac下finder子目录直接打开终端
    golang之交叉编译设置
    cocos2dx 3.0 编译工程
    2dx 3.0环境配置(mac)
    golang调用动态库
    qt下用启动图
    qt在动态库里面加载widget的例子
    qt笔记
  • 原文地址:https://www.cnblogs.com/ice-ice/p/3751606.html
Copyright © 2011-2022 走看看