代码拉取完成,页面将自动刷新
<?php session_start();
include("conn.php");
?>
<html>
<head>
<title>添加留言</title>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<link href="css/examples.css" rel="stylesheet" type="text/css">
<link href="css/jquery.fancybox.css" rel="stylesheet" type="text/css">
<link href="css/slider-pro.css" rel='stylesheet' type='text/css' />
<link href="css/timeline.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel='stylesheet' type='text/css' />
<link href="css/fontawesome-all.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" charset="utf-8" src="ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<div class="main-sec">
<?php include"header.php";?>
</div>
<section class="wthree-banner-bottom py-lg-5 py-3" style="background-color: #FFFFFF;margin: 0,0;padding: 0,0;">
<div class=" py-lg-4 py-3"width="auto">
<form action=" " onsubmit="return check_form();" method="post" id="form1">
<table width="100%" align="center">
<tr>
<td>
<table>
<tr><td colspan="2"> </td></tr>
<tr >
<td>标题:</td>
<td><input type="text" onblur="check_title()" name="title" id="title" placeholder="请输入标题"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%">
<tr align="left" >
<td colspan="2" height="200px">内容:
<textarea name="content" row="50px"style="width: 100%;height: 200px;" class="editor" cols="50px" id="editor" onblur="ckeck_liuyan()"></textarea>
<script type="text/plain" class="editor" onblur="ckeck_liuyan()" name="content" id="editor" charset="UTF-8"></script>
<script type="text/javascript">
UE.getEditor("editor",
{toolbars:[['undo', //撤销
'redo', //重做
'bold', //加粗
'indent', //首行缩进
'italic', //斜体
'underline', //下划线
'strikethrough', //删除线
'subscript', //下标
'fontborder', //字符边框
'superscript', //上标
'formatmatch', //格式刷
'source', //源代码
'blockquote', //引用
'pasteplain', //纯文本粘贴模式
'selectall', //全选
'print', //打印
'preview', //预览
'horizontal', //分隔线
'removeformat', //清除格式
'touppercase', //字母大写
'tolowercase', //字母小写
'cleardoc', //清空文档
'fontfamily', //字体
'fontsize', //字号
'paragraph', //段落格式
'edittable', //表格属性
'edittd', //单元格属性
'link', //超链接
'emotion', //表情
'spechars', //特殊字符
'searchreplace', //查询替换
'justifyleft', //居左对齐
'justifyright', //居右对齐
'justifycenter', //居中对齐
'justifyjustify', //两端对齐
'forecolor', //字体颜色
'backcolor', //背景色
'insertorderedlist', //有序列表
'insertunorderedlist', //无序列表
'fullscreen', //全屏
'directionalityltr', //从左向右输入
'directionalityrtl', //从右向左输入
'imageleft', //左浮动
'imageright', //右浮动
'imagecenter', //居中
]],})
</script>
</td>
</tr>
</table>
</td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr>
<td>
<table width="100%">
<tr align="center">
<td align="center">
<input type="submit"name="submit" style="font-size:17px;border-radius: 12px;" class="btn" value="发布留言"/>
<input type="reset" style="font-size:17px;border-radius: 12px;" class="btn" value="重置"/>
</td>
</tr>
</table>
</td>
</tr>
<tr><td colspan="2"> </td></tr>
</table>
</form>
<?php
if(!isset($_SESSION["username"])){
echo "<script type='text/javascript'>alert('未登录,请登录后进行留言');location='user_login.php';</script>";
}else{
if(isset($_POST["submit"])){
$name=$_SESSION["username"];
if($_POST["content"]==""){
echo "<script language='javascript'>alert('留言不能为空');</script>";
die();
}
$title=$_POST["title"];
$liuyan=$_POST["content"];
include "conn.php";
$time=date("Y-m-d H:i:s");
$query="insert into mess(m_title ,m_content,m_date,m_user)value('".$title."','".$liuyan."','".$time."','".$name."');";
$res = $mysqli->query($query);
if($res){
echo "<script type='text/javascript'>alert('留言成功,正在跳转到显示留言页');location='showly.php';</script>";
}else{
//插入失败则输出错误编号和错误信息
echo "用户已存在请使用其他用户名";
echo "<script type='text/javascript'>alert('留言失败');</script>";
}
}else{
}
}
?>
</div>
</section>
<footer class="footer-sec-w3layouts py-lg-5 py-3" >
<?php include"footer.php";?>
</footer>
<!-- //Custom-JavaScript-File-Links -->
<!-- js -->
<script src="js/jquery-2.2.3.min.js"></script>
<!--slider-->
<!-- banner slider -->
<script src="js/responsiveslides.min.js"></script>
<script>
$(function() {
$("#slider4").responsiveSlides({
auto: true,
pager: true,
nav: false,
speed: 1000,
namespace: "callbacks",
before: function() {
$('.events').append("<li>before event fired.</li>");
},
after: function() {
$('.events').append("<li>after event fired.</li>");
}
});
});
</script>
<!-- //banner slider -->
<!-- dropdown nav -->
<script>
$(document).ready(function() {
$(".dropdown").hover(
function() {
$('.dropdown-menu', this).stop(true, true).slideDown("fast");
$(this).toggleClass('open');
},
function() {
$('.dropdown-menu', this).stop(true, true).slideUp("fast");
$(this).toggleClass('open');
}
);
});
</script>
<!-- //dropdown nav -->
<script src="js/jquery.sliderPro.min.js"></script>
<script src="js/jquery.fancybox.pack.js"></script>
<script>
$(document).ready(function($) {
$('#example2').sliderPro({
width: 350,
height: 400,
visibleSize: '100%',
forceSize: 'fullWidth',
autoSlideSize: true
});
// instantiate fancybox when a link is clicked
$(".slider-pro").each(function() {
var slider = $(this);
slider.find(".sp-image").parent("a").on("click", function(event) {
event.preventDefault();
if (slider.hasClass("sp-swiping") === false) {
var sliderInstance = slider.data("sliderPro"),
isAutoplay = sliderInstance.settings.autoplay;
$.fancybox.open(slider.find(".sp-image").parent("a"), {
index: $(this).parents(".sp-slide").index(),
afterShow: function() {
if (isAutoplay === true) {
sliderInstance.settings.autoplay = false;
sliderInstance.stopAutoplay();
}
},
afterClose: function() {
if (isAutoplay === true) {
sliderInstance.settings.autoplay = true;
sliderInstance.startAutoplay();
}
}
});
}
});
});
});
</script>
<!-- /timeline -->
<script src="js/timeline.min.js"></script>
<script>
timeline(document.querySelectorAll('.timeline'), {
forceVerticalMode: 700,
mode: 'horizontal',
verticalStartPosition: 'left',
visibleItems: 4
});
</script>
<!-- //timeline -->
<!-- //js -->
<script src="js/bootstrap.js"></script>
<!--/ start-smoth-scrolling -->
<script src="js/move-top.js"></script>
<script src="js/easing.js"></script>
<script>
jQuery(document).ready(function($) {
$(".scroll").click(function(event) {
event.preventDefault();
$('html,body').animate({
scrollTop: $(this.hash).offset().top
}, 900);
});
});
</script>
<script>
$(document).ready(function() {
/*
var defaults = {
containerID: 'toTop', // fading element id
containerHoverID: 'toTopHover', // fading element hover id
scrollSpeed: 1200,
easingType: 'linear'
};
*/
$().UItoTop({
easingType: 'easeOutQuart'
});
});
</script>
<!--// end-smoth-scrolling -->
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。