• 每日博客5.25


    <?php 
    $lb=$_GET["lb"];
    include_once 'conn.php';

    $ndate =date("Y-m-d");
    $addnew=$_POST["addnew"];
    if ($addnew=="1" )
    {
    $content=$_POST["neirong"];
    $sql="update dx set content='$content' where leibie= '".$lb."'";

    mysql_query($sql);
    echo "<script>javascript:alert('操作成功!');location.href='dx.php?lb=$lb';</script>";
    }
    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>修改dx</title>
    <link rel="stylesheet" href="kindeditor-4.1.10/themes/default/default.css" />
    <link rel="stylesheet" href="kindeditor-4.1.10/plugins/code/prettify.css" />
    <script charset="utf-8" src="kindeditor-4.1.10/kindeditor.js"></script>
    <script charset="utf-8" src="kindeditor-4.1.10/lang/zh_CN.js"></script>
    <script charset="utf-8" src="kindeditor-4.1.10/plugins/code/prettify.js"></script>
    <script>
    KindEditor.ready(function(K) {
    var editor1 = K.create('textarea[name="neirong"]', {
    cssPath : 'kindeditor-4.1.10/plugins/code/prettify.css',
    uploadJson : 'kindeditor-4.1.10/php/upload_json.php',
    fileManagerJson : 'kindeditor-4.1.10/php/file_manager_json.php',
    allowFileManager : true,
    afterCreate : function() {
    var self = this;
    K.ctrl(document, 13, function() {
    self.sync();
    K('form[name=example]')[0].submit();
    });
    K.ctrl(self.edit.doc, 13, function() {
    self.sync();
    K('form[name=example]')[0].submit();
    });
    }
    });
    prettyPrint();
    });
    </script>

    <link rel="stylesheet" href="css.css" type="text/css">
    </head>
    <script language="javascript">
    function OpenScript(url,width,height)
    {
    var win = window.open(url,"SelectToSort",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
    }
    function OpenDialog(sURL, iWidth, iHeight)
    {
    var oDialog = window.open(sURL, "_EditorDialog", "width=" + iWidth.toString() + ",height=" + iHeight.toString() + ",resizable=no,left=0,top=0,scrollbars=no,status=no,titlebar=no,toolbar=no,menubar=no,location=no");
    oDialog.focus();
    }
    </script>
    <body>
    <p>修改<?php echo $lb;?>: 当前日期: <?php echo $ndate; ?></p>
    <?php
    $sql="select * from dx where leibie='".$lb."'";
    $query=mysql_query($sql);
    $rowscount=mysql_num_rows($query);
    if($rowscount>0)
    {
    ?>
    <form id="form1" name="form1" method="post" action="">
    <table width="100%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#00FFFF" style="border-collapse:collapse">
    <tr>
    <td>内容:</td>
    <td><textarea name="neirong" style="700px;height:400px;visibility:hidden;"><?php echo mysql_result($query,$i,content)?></textarea></td></tr>
    <tr>
    <td>&nbsp;</td>
    <td><input name="addnew" type="hidden" id="addnew" value="1" />
    <input type="submit" name="Submit" value="修改" />
    <input type="reset" name="Submit2" value="重置" /></td>
    </tr>
    </table>
    </form>
    <?php
    }
    else
    {
    $sql="insert into dx(leibie,content) values('$lb','$lb')";
    mysql_query($sql);
    echo "<script language='javascript'>location.href='dx.php?lb=$lb';</script>";
    }
    ?>
    </body>
    </html>

  • 相关阅读:
    Umbraco建站指南[0]:前言
    项目开发中一些不得其解的问题
    Maven Install 的傻问题
    html5 audio/video 操作
    CentOS7.3安装MySQL5.7
    Maven将独立jar包安装到本地库
    MyBatis 中 foreach 语句处理 List<Integer>类型
    站内信系统的设计思路
    Spring+MyBatis项目开发代码步骤
    webpack 配置eslint-standard
  • 原文地址:https://www.cnblogs.com/wanghaoning/p/14914874.html
Copyright © 2020-2023  润新知