每日博客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="width: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>

posted @ 2021-05-25 19:24  王昊宁  阅读(32)  评论(0编辑  收藏  举报