注册用户的一些细节问题
一些提示信息
检测用户名是否注册过,和user表相关联
check.php
<?php
require ("system/dbConn.php");
$con=connect();
$u=$_GET["name"];
//判断用户是否存在,存在不用再注册
$sql="select * from users where uname='$u' ";
$rs=mysqli_query($con,$sql);//执行
echo mysqli_num_rows($rs);
?>
找到注册表单的文件
-
$sql="select * from users where uname='$un'";
//判断用户是否存在,存在不用再注册 -
$res=mysqli_query($con,$sql);
-
if (mysqli_num_rows($res)){ echo "<script>alert('该用户名已存在,请重新注册'); location.href='index.php';//从这个文件读取?????????
注册表单doUserReg.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>处理注册信息</title>
</head>
<body>
<?php
var_dump($_FILES);
//文件名
$arr=explode(".",$_FILES["pic"]["name"]);//把原文件名切割
$ex=$arr[count($arr)-1];//获得扩展名
$fname=date("YmdHis").rand(100,999).".".$ex;
//获取信息
$un=$_POST["username"];
$pw=$_POST["password"];
$gender=$_POST["gender"];
//$hobby=implode(",",$_POST["hobby"]);
$email=$_POST["email"];
$birth=$_POST["birthdate"];
$con = mysqli_connect("localhost:3306","wsw","123","neuvideo") or die("连不上服务器");
mysqli_query($con,"set names utf8");
//判断用户是否存在,存在不用再注册
$sql="select * from users where uname='$un'";
$res=mysqli_query($con,$sql);
if (mysqli_num_rows($res)){
echo "<script>alert('该用户名已存在,请重新注册');
location.href='index.php';//从这个文件读取?????????
</script>";
}
move_uploaded_file($_FILES["pic"]["tmp_name"], "images/$fname");///将上传的文件放到upload里
$sql="INSERT into users values(null,'$un',md5('$pw'),$gender,'$birth','$fname','$email')";//要和你users表的参数相对应
echo $sql;//测试,拷贝浏览器的sql语句,到数据库里执行
if (mysqli_query($con,$sql)){
echo "成功";
}else{
echo "失败";
}
?>
<table border="1" width="400px">
<tr>
<td>用户名</td>
<td><?php echo $_POST["username"]; ?></td>
</tr>
<tr>
<td>密码</td>
<td><?php echo $_POST["password"]; ?></td>
</tr>
<tr>
<td>性别</td>
<td><?php echo ($_POST["gender"]==0)?"男":"女"; ?></td>
</tr>
<tr>
<td>生日</td>
<td><?php echo $_POST["password"]; ?></td>
</tr>
<!-- <tr>-->
<!-- <td>爱好</td> -->
<!-- <td>--><?php //echo implode(",",$_POST["hobby"]); ?><!--</td>-->
<!-- </tr>-->
<tr>
<td>邮箱</td>
<td><?php echo $_POST["email"]; ?></td>
</tr>
<tr>
<td>头像</td>
<td><img src="images/<?php echo $fname; ?>" width="200px"></td>
</tr>
</table>
</body>
</html>
显示样式
- 验证用户名是否存在(在JavaScript中书写)。写一个函数
var user = document.getElementById("exampleInputUserName").value;
//获取用户名- 表单控件有value,div就没有!!!
user!=null
//为空就可以使用,说明里面没有该用户名user!=""
//后面是防止浏览器不同- jQuery ajax
$.get("check.php?name="+user,function(data){
//url,返回函数存返回数据。用匿名函数只在这里s使用。传参?name="+userif (data>0) document.getElementById("tip").innerHTML="用户名已被占用!";//div没有value属性 else document.getElementById("tip").innerHTML="<span style='color: green'>该用户名可用</span>";//div没有value属性
document.getElementById("tip").innerHTML="用户名不能为空!";
//提示输入用户名不能为空
完整注册的提示信息——tpl-head.php
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>视频信息管理系统</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="assets/css/offcanvas.css" rel="stylesheet">
<link href="assets/css/style.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]>
<script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="assets/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
//验证用户名是否存在
function checkuser() {
//获取用户名
var user = document.getElementById("exampleInputUserName").value;//表单控件有value
//为空就可以使用,说明里面没有该用户名
if (user!=null && user!=""){//后面是防止浏览器不同
//jQuery ajax
$.get("check.php?name="+user,function(data){//url,返回函数存返回数据。用匿名函数只在这里s使用。传参?name="+user
// alert(data);//会弹出数据库和你输入的名称有几个
if (data>0)
document.getElementById("tip").innerHTML="用户名已被占用!";//div没有value属性
else document.getElementById("tip").innerHTML="<span style='color: green'>该用户名可用</span>";//div没有value属性
});
}else {
//提示输入用户名不能为空
document.getElementById("tip").innerHTML="用户名不能为空!";//div没有value属性
// ajax实现局部更新——不刷新也能实现刷新
}
}
</script>
</head>
<body>
<nav class="navbar navbar-fixed-top navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<?php
require_once("./system/dbConn.php");
// require_once("../system/myFunc.php");
$con=connect();
//表连接(videotype的内容全部输出,以他为左)
$sql="select t.tid,typename,count(vid) cv from videotype t LEFT JOIN videos v ON t.tid=v.tid GROUP BY t.typename";
$rs=mysqli_query($con,$sql);
?>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="index.php">首页</a></li>
<?php while( $row = mysqli_fetch_array($rs)) { ?>
<li><a href="list.php?tid=<?php echo $row["tid"];?>">
<?php echo $row["typename"];?>(<?php echo $row["cv"]; ?>)
</a></li>
<?php } ?>
</ul>
<form class="navbar-form navbar-left" role="search" action="search.php">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">搜索</button>
</form>
<ul class="nav navbar-nav navbar-right">
<!-- 模态框-->
<?php if (!isset($_SESSION["user"])){?>
<li><a href="#" data-toggle="modal" data-target="#login">登录</a></li>
<li><a href="#" data-toggle="modal" data-target="#reg">注册</a></li>
<?php }else{ ?>
<!-- data-toggle="modal" data-target="#login"-->
<li><a href="#">欢迎<?php echo $_SESSION["user"];?></a></li>
<!-- data-toggle="modal" data-target="#logout"-->
<li><a href="logout.php" >注销</a></li>
<?php } ?>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<!-- /.navbar -->
<!-- /注册模态框 -->
<div class="modal fade" id="reg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel" style="color: dodgerblue;font-weight: bold;font-size: 20px">注册信息</h4>
</div>
<div class="modal-body">
<form method="post" action="doUserReg.php" enctype="multipart/form-data" class="form-horizontal">
<div class="form-group">
<label for="exampleInputUserName" class="col-md-2 control-label">用户</label>
<div class="col-md-10">
<!-- onblur="checkuser()"-->
<input type="text" name="username" class="form-control" id="exampleInputUserName" placeholder="姓名" required="" onblur="checkuser()">
<!-- 为空的时候显示提示框-->
<div id="tip" style="color: red"></div>
</div>
</div>
<div class="form-group">
<label for="exampleInputPassword" class="col-md-2 control-label">密码</label>
<div class="col-md-10">
<input type="password" name="password" class="form-control" id="exampleInputPassword" placeholder="密码" required="">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">性别</label>
<div class="col-md-10">
<label class="radio-inline">
<input type="radio" name="gender" value="0" checked=""> 男
</label>
<label class="radio-inline">
<input type="radio" name="gender" value="1"> 女
</label>
</div>
</div>
<div class="form-group">
<label for="exampleInputBirth" class="col-md-2 control-label">生日</label>
<div class="col-md-10">
<input type="date" name="birthdate" class="form-control" id="exampleInputBirth" placeholder="生日" required="">
</div>
</div>
<div class="form-group">
<label for="exampleInputFile" class="col-md-2 control-label">头像</label>
<div class="col-md-10">
<input type="file" name="pic" id="exampleInputFile" required="">
</div>
</div>
<div class="form-group">
<label for="exampleInputEmail" class="col-md-2 control-label">电子邮件</label>
<div class="col-md-10">
<input type="email" name="email" class="form-control" id="exampleInputEmail" placeholder="常用邮箱" required="">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="btn btn-default" value="注册">
<input type="reset" class="btn btn-default" value="重置">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="location.replace('index.php')" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<!-- /注册模态框结束 -->
<!-- /登录模态框开始 -->
<div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel" style="color: dodgerblue;font-weight: bold;font-size: 20px">用户 登入</h4>
</div>
<div class="modal-body">
<form name="fm" method="post" action="doLogin.php" onsubmit="return check()" class="form-horizontal">
<input type="hidden" name="vid" id="videoid" >
<div class="form-group">
<label for="exampleInputUserName1" class="col-md-2 control-label">用户名</label>
<div class="col-md-4">
<input type="text" name="username" class="form-control" id="exampleInputUserName1" placeholder="姓名" required>
</div>
<div class="col-md-6">
</div>
</div>
<div class="form-group">
<label for="exampleInputPassword1" class="col-md-2 control-label">密码</label>
<div class="col-md-4">
<input type="password" name="pswd" class="form-control" id="exampleInputPassword1" placeholder="密码" required>
</div>
<div class="col-md-6">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="btn btn-default" value="登录">
<input type="reset" class="btn btn-default" value="重置">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="location.replace('index.php')" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<!-- /登录模态框结束 -->
效果::
userlist.php
实现用户列表的分页和布局
$con=connect();
//调用连接数据库函数,返回值是连接号$sql="select * from users ORDER BY uid DESC ";//sql语句
//搜索 if(isset($_GET["key"])){ $k=$_GET["key"]; $sql="select * from users where uname like '%$k%' order by uid desc";//sql语句 }
- 删除_删除每列后的选项——是同一个文件——判断是删除的哪个用户,超链后面的key值来区分——主见
$rs=mysqli_query($con,$sql); $num=mysqli_num_rows($rs);//总记录数
$pageSize=3;//每个页显示多少条记录
$pageNum=ceil($num/$pageSize); //一共多少页,向上取整10/3
$page=$_GET["page"];//当前的页号
$start=($page-1)*$pageSize;//起始页号
$sql="select * from users order by uid desc limit $start,$pageSize";
排序<a href="userlist.php?page=1">首页</a>
<a href="userlist.php?page=<?php echo($page - 1); ?>">上一页</a>
<a href="userlist.php?page=<?php echo($page + 1); ?>">下一页</a>
<a href="userlist.php?page=<?php echo $pageNum;?>">尾页</a>
- 如果没有任何记录,$pageNum=0,尾页的超链page=0;在尾页点击上一页,page=-1
<form action="">
请输入用户名:
<input type="text" name="key">
<input type="submit" value="搜索">
</form>
完整代码-userlist.php
<?php
require_once('tpl/header.php');
?>
<form action="">
请输入用户名:
<input type="text" name="key">
<input type="submit" value="搜索">
</form>
<?php
//调用dbConn.php
调用连接数据库函数,返回值是连接号
$con=connect();
$sql="select * from users ORDER BY uid DESC ";//sql语句
//搜索
if(isset($_GET["key"])){
$k=$_GET["key"];
$sql="select * from users where uname like '%$k%' order by uid desc";//sql语句
}
//删除_删除每列后的选项——是同一个文件——判断是删除的哪个用户,超链后面的key值来区分——主见
$rs=mysqli_query($con,$sql);
$num=mysqli_num_rows($rs);//总记录数
$pageSize=3;//每个页显示多少条记录
$pageNum=ceil($num/$pageSize); //一共多少页,向上取整10/3
if(isset($_GET["page"])&&$_GET["page"]!="")
$page=$_GET["page"];//当前的页号
else $page=1;//当前是哪一页
$start=($page-1)*$pageSize;//起始页号
$sql="select * from users order by uid desc limit $start,$pageSize";
$rs=mysqli_query($con,$sql);//执行
?>
<a href="userlist.php?page=1">首页</a>
<?php
if ($page!=1) {
?>
<a href="userlist.php?page=<?php echo($page - 1); ?>">上一页</a>
<?php
}
if ($page!=$pageNum) {
?>
<a href="userlist.php?page=<?php echo($page + 1); ?>">下一页</a>
<?php
}
?>
<!-- 如果没有任何记录,$pageNum=0,尾页的超链page=0;在尾页点击上一页,page=-1-->
<a href="userlist.php?page=<?php echo $pageNum;?>">尾页</a>
<form action="">
<!-- 跳转文本框只填写数字-->
<input type="text" name="page" size="3">
<input type="button" value="提交">
</form>
<table class="table table-hover">
<caption>共有 <?php
echo $num;
?>
名用户</caption>
<tr>
<th>用户编号</th>
<th>用户名</th>
<th>性别</th>
<th>生日</th>
<th width='80'>头像</th>
<th>电子邮件</th>
<th>操作</th>
</tr>
<?php
$i=0;
while ($row = mysqli_fetch_array($rs)){//
?>
<tr>
<td><?php echo ++$i;//先加 后打印?></td>
<td><?php echo $row["uname"];?></td>
<td><?php
echo ($row["gender"]==0)?"男":"女"
?></td>
<td>
<?php
echo $row["birthdate"] ?></td>
<td><img src="../images/<?php echo $row["pic"];?>" width=60 height=60 title= alt=""></td>
<td><?php
echo $row["email"]
?></td>
<td><a href="userEdit.php?uid=<?php echo $row["uid"]; ?>">修改</a>
| <a href="userDelete.php?uid=<?php echo $row["uid"]; ?>">删除</a></td>
</tr>
<?php
} ?>
</table>
<?php
require_once('tpl/footer.php');
?>
效果
举一反三:前台列表页的实现—list.php
效果:
<?php
require_once('tpl/head.php');
include_once('./system/dbConn.php');
$con=connect();
$tid=$_GET['tid'];
$sql_num="select * from videos where tid=$tid";
$rs_num=mysqli_query($con,$sql_num);
$num=mysqli_num_rows($rs_num);//总记录数
$pageSize=4;//每个页显示多少条记录
$pageNum=ceil($num/$pageSize);//一共多少页,向上取整10/3
if(isset($_GET["page"])&&$_GET["page"]!="")
$page=$_GET["page"];//当前的页号
else
$page=1;
$start=($page-1)*$pageSize;//起始页号
$sql="select * from videos where tid=$tid order by vid desc limit $start,$pageSize";
$rs=mysqli_query($con,$sql);//执行
$sql_typename = "select typename from videotype where tid=$tid";
$rs_typename = mysqli_query($con,$sql_typename);
$type = mysqli_fetch_array($rs_typename);
?>
<div class="container">
<div class="row row-offcanvas row-offcanvas-right">
<div class="col-xs-12 col-sm-9">
<div class="row">
<div class="col-xs-12 col-lg-12 mlist" style="margin-top: 40px;">
<!-- 专栏名称-->
<h2><?php echo $type["typename"];?></h2>
<ul class="list-inline row text-center">
<?php
while($row=mysqli_fetch_array($rs)){
?>
<li class="col-xs-6 col-lg-3">
<img src="posters/<?php echo $row["pic"]; ?>" class="responsive img-thumbnail"/>
<!-- 视频标题-->
<p><a href="show.php?vid=<?php echo $row["vid"];?>"><?php echo $row["videoname"]; ?></a>
</p>
</li>
<?php } ?>
</ul>
<nav class="text-center">
<ul class="pagination">
<?php if($page!=1){?>
<li>
<a href="list.php?page=<?php echo ($page-1);?>&tid=<?php echo $tid; ?>" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
</li>
<?php } ?>
<?php for($i=1; $i<=$pageNum; $i++){ ?>
<li>
<a href="list.php?page=<?php echo $i?>&tid=<?php echo $tid ?>">第<?php echo $i;?>页</a>
</li>
<?php } ?>
<?php if($page!=$pageNum){ ?>
<li>
<a href="list.php?page=<?php echo ($page+1); ?>&tid=<?php echo $tid; ?>" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
<?php } ?>
</ul>
</nav>
</div>
<!--/.col-xs-6.col-lg-4-->
</div>
<!--/row-->
</div>
<!--/.col-xs-12.col-sm-9-->
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" style="margin-top: 40px;">
<div class="list-group text-center" >
<h2 style="color:white;">下载排行</h2>
<ul class="list-inline row text-center">
<?php
$sql_hit="select * from videotype join videos on videos.tid = videotype.tid WHERE videotype.tid=$tid order by hittimes desc limit 4";
$rs_hit=mysqli_query($con,$sql_hit);
while ($row_hit = mysqli_fetch_array($rs_hit)){
?>
<li class="col-xs-12 col-lg-6">
<img src="posters/<?php echo $row_hit["pic"] ?>" class="responsive img-thumbnail"/>
<p><a href="show.php?vid=<?php echo $row_hit["vid"]?>"><?php echo $row_hit["videoname"] ?></a>
</p>
</li>
<?php } ?>
</ul>
</div>
</div>
<!--/.sidebar-offcanvas-->
</div>
<!--/row-->
</div>
<!--/.container-->
<?php
require_once('tpl/foot.php');
?>
从前台列表页的实现—list.php点击后进入show.php是每个自己的单独介绍
前台视频详细内容页的实现 show.php
先测试sql语句是否好用
用vid=3测试
$sql="select * from videos v JOIN videotype t ON v.tid=t.tid JOIN admins a ON v.uploadadmin=a.adminid WHERE vid=3"
放入数据库中进行查看
- 更新表
//点击次数加1 $sql1="update videos set hittimes=hittimes+1 WHERE vid=$vid";
- 添加视频链接
在路径下创建视频
在数据库中写上地址
<video id="myVideo" src="videos/<?php echo $row["address"];?>" controls width="100%" height="100%"></video>
- 专栏
<?php echo $row["typename"];?>
- 上传时间
<?php echo $row["uploaddate"];?>
- 点击次数
<?php echo $row["hittimes"];?>
- 下载次数
<?php echo $row["downtimes"];?>
- 下载地址
<a href="down.php?vid=<?php echo $row["vid"];?>" >点击这里下载</a>
- 内容简介
<?php echo $row["intro"];?>
留言列表
在数据库中添加几条数据
<?php
$sql="select * from comments c JOIN users u on c.uid = u.uid where vid=$vid";
$rs=mysqli_query($con,$sql);
?>
完整show.php代码
<link href="assets/css/play.css" rel="stylesheet">
<?php
require_once('tpl/head.php');
include_once('./system/dbConn.php');
$con=connect();//连接数据库
$vid=$_GET["vid"];
//点击次数加1
$sql1="update videos set hittimes=hittimes+1 WHERE vid=$vid";
mysqli_query($con,$sql1);
//$sql="select * from videos v JOIN videotype t ON v.tid=t.tid JOIN admins a ON v.uploadadmin=a.adminid WHERE vid=3"
$sql="select * from videos v JOIN videotype t ON v.tid=t.tid JOIN admins a ON v.uploadadmin=a.adminid WHERE vid=$vid";
$rs=mysqli_query($con,$sql);
$row=mysqli_fetch_array($rs);
?>
<!-- 从show页登录成功后取得vid 并跳转到登录模态框-->
<!-- /修改个人信息模态框结束 --><div class="container">
<div class="row row-offcanvas row-offcanvas-right">
<div class="col-xs-12 col-sm-12">
<div class="row box">
<div class="col-md-4 text-center">
<img src="posters/<?php echo $row["pic"]; ?>" width="270" height="320" >
<!-- 点击标题显示新窗口中的视频-->
<div class="theme-buy">
<a class="theme-login" href="javascript:;">
<h3 class="brand-name" title="点击这里可在线播放~">
<?php echo $row["videoname"]; ?><img src="assets/images/play.png" width="30px" height="30px">
</h3></a>
</div>
<div class="theme-popover">
<div class="theme-poptit">
<a href="javascript:;" title="关闭" class="close">×</a>
<h4><?php echo $row["videoname"]; ?> </h4>
</div>
<div>
<video id="myVideo" src="videos/<?php echo $row["address"];?>" controls width="100%" height="100%"></video>
</div>
</div>
<div class="theme-popover-mask"></div>
<!-- 点击标题显示新窗口中的视频-->
<!-- 显示总评分-->
<ul class="list-inline row text-center">
<li><h4>影片评分:</h4></li>5.0 </ul>
<!-- 显示总评分 结束-->
</div>
<div class="col-md-8 text-center">
<table class="table">
<tr>
<td>专栏</td>
<!-- 电视剧-->
<td><?php echo $row["typename"];?></td>
</tr>
<tr>
<!-- -->
<td>上传时间</td>
<td><?php echo $row["uploaddate"];?></td>
</tr>
<tr>
<td>点击次数</td>
<td><?php echo $row["hittimes"];?></td>
</tr>
<tr>
<td>上传人</td>
<td>admin</td>
</tr>
<tr>
<td>下载次数</td>
<td> <?php echo $row["downtimes"];?></td>
</tr>
<tr>
<td>有事找站长</td>
<td><a href="mailto:zhouhaibo@neusoft.edu.cn">意见箱</a>
</td>
</tr>
<tr>
<td>下载地址</td>
<td> <a href="down.php?vid=<?php echo $row["vid"];?>" >点击这里下载</a>
</td>
</tr>
<tr>
<td>评分</td>
<td>
<h3 ><a href="#" data-toggle="modal" data-target="#login" onclick="func(<?php echo $row["vid"];?>)">登录</a>后可以评分</h3>
</td>
</tr>
</table>
</div>
</div>
<!--/row-->
<div class="row box">
<div class="col-lg-12">
<h3 class="intro-text text-center">内容简介</h3>
<?php echo $row["intro"];?>
</div>
</div>
<div class="row box">
<div class="col-md-12">
<?php
$sql="select * from comments c JOIN users u on c.uid = u.uid where vid=$vid";
$rs=mysqli_query($con,$sql);
?>
<h3 class="intro-text text-center">留言列表</h3>
<table class="table" align="center">
<tr>
<th>序号</th>
<th>内容</th>
<th>评论人</th>
<th>发表时间</th>
</tr>
<?php
$i=1;
while ($row=mysqli_fetch_array($rs)) {
?>
<tr>
<td width="10%"><?php echo $i++;?></td>
<!-- 我信你个鬼 你个糟老头子-->
<td width="50%"><?php echo $row["content"];?></td>
<!-- admin-->
<td width="20%"> <?php echo $row["uname"];?></td>
<!--
<!-- 2018-11-28 13:18:05-->
<td width="20%"><?php echo $row["cdate"];?></td>
</tr>
<?php
}
?>
</table>
<div align="center">
共1条记录 首页 上一页 <a href=show.php?vid=127&page=1>第1页</a> 下一页 尾页</div>
</div>
</div>
<div class="row box">
<div class="col-lg-12" style="align:center;">
<h3 ><a href="#" data-toggle="modal" data-target="#login" onclick="func()">登录</a>后可以发表留言</h3>
</div>
</div>
</div>
<!--/.col-xs-12.col-sm-12-->
</div>
<!--/row-->
</div>
<!--/.container-->
<?php
require_once('tpl/foot.php');
include_once('./system/dbConn.php');
?>
<!--foot.php使用jQuery-->
<script>
function func(vid){
document.getElementById("videoid").value=vid;
document.getElementById("login").modal();
}
</script>
<!-- 从show页登录成功后取得vid 并跳转到登录模态框-->
<!-- 弹窗显示视频的资源 css和jQ-->
<script>
jQuery(document).ready(function($) {
$('.theme-login').click(function(){
$('.theme-popover-mask').fadeIn(100);
$('.theme-popover').slideDown(200);
})
$('.theme-poptit .close').click(function(){
var myVideo=$('#myVideo')[0];
myVideo.pause();
$('.theme-popover-mask').fadeOut(100);
$('.theme-popover').slideUp(200);
})
})
</script>
<!-- 弹窗显示视频的资源 css和jQ end-->