layui注册页面事例和日志的方法

layui注册页面的事例:

layui.use('layer', function (){
        var layer = layui.layer;
        layer.open({
            title: '注册页面',
            area: ['400px', '360px'],
            content:'<span style="float:left">账号:&nbsp&nbsp&nbsp&nbsp</span>' +
                    '<input type="text" name="text" id="uid" placeholder="请输入账号" autocomplete="off" class="layui-input" style="margin-top:-5px" />' +
                    '<span style="float:left;margin-top:20px">用户名:</span>' +
                    '<input type="text" name="text" id="name" placeholder="请输入用户名" autocomplete="off" class="layui-input" style="margin-top:15px" />' +
                    '<span style="float:left;margin-top:23px">密码:&nbsp&nbsp&nbsp</span>' +
                    '<input type="password" name="password" id="pwd" placeholder="请输入密码" autocomplete="off" class="layui-input" style="margin-top:15px" />' +
                    '<input type="password" name="password" id="pswd" placeholder="请再次输入密码" autocomplete="off" class="layui-input" style="margin-top:15px;margin-left:0px" />',
             yes: function (index, layero){
              }

 

定义一个日志的方法:
function movieLog($str){
    $db = new MySQLi("localhost","root","","z_0705");
    !mysqli_connect_error() or die("数据库连接错误");
    $db->query("set names utf8");
    $uid = $_SESSION['uid'];
    $name= $_SESSION["uname"] ;
    $time = date('Y-m-d H:i:s');
    $sql = "insert into movie_log(uid,uname,time,str)values('$uid','$name','$time','$str')";
    $db->query($sql);
}

posted @ 2018-09-14 22:59  Prinlily  阅读(688)  评论(0编辑  收藏  举报