Php Zebra日期选择器过帐空白变量

Php Zebra日期选择器过帐空白变量,php,jquery,mysqli,datepicker,Php,Jquery,Mysqli,Datepicker,我正在实现斑马日期选择器 在选择日期时,日期在文本字段中可见,但当我试图通过$\u POST检索值时,该值将作为空白插入数据库 你能告诉我怎么解决这个问题吗 我的php代码: <?php if(isset($_POST['sub'])) { include("connect.php"); $ip=get_client_ip(); $date=date("Y-m-d H:m:s"); $dob=$_POST['dat'];//the zebra datepi

我正在实现斑马日期选择器

在选择日期时,日期在文本字段中可见,但当我试图通过
$\u POST
检索值时,该值将作为空白插入数据库

你能告诉我怎么解决这个问题吗

我的php代码:

<?php
if(isset($_POST['sub']))
{
    include("connect.php");

    $ip=get_client_ip();
    $date=date("Y-m-d H:m:s");
    $dob=$_POST['dat'];//the zebra datepicker value
    ...
    insert code mysqli...
}
?>

html日期选择器字段:

<h6 class="label">Date of Birth*</h6>
<div class="row">
    <div class="col-sm-3">
        <input type="text" name="dat" id="datepicker" placeholder="Date Of Birth" >
    </div>
</div>
出生日期*
日期选择器Js:

<script type="text/javascript">
$('#datepicker').Zebra_DatePicker();
</script>

$(“#日期选择器”).zebrau datepicker();
试试这段代码

<?php 

if ( isset( $_POST['dat'] ) ) {
    print_r($_POST);
    exit;
}

?>
<!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=utf-8" />
<title>Untitled Document</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="zebra_datepicker.js"></script>
</head>

<body>
<h6 class="label">Date of Birth*</h6>
<form method="post" >
<div class="row">
    <div class="col-sm-3">
        <input type="text" name="dat" id="datepicker" placeholder="Date Of Birth" >
    </div>
</div>
<input type="submit" />
</form>
<script type="text/javascript">
$('#datepicker').Zebra_DatePicker();
</script>
</body>
</html>

无标题文件
出生日期*
$(“#日期选择器”).zebrau datepicker();

确保jquery路径和css路径是绝对写入的,并检查控制台

print\r($\u POST);和show result plzi已经通过向$dob发出警报测试了datepicker值,其警报为空白值。您正在使用服务器端(php)或客户端请求(ajax)进行发布?php我没有使用ajax。Okk我正在尝试在选择“数组([dat]=>2014-08-14)时打印此值“这是因为它返回的是您选择的值,它是正确的,您想要什么我不明白,那为什么会出现问题,我哪里出错了?”?可能是您遗漏了什么,它与您之前编写的代码相同,但您自上而下地调试代码,以检查我哪里出错了。也许你遗漏了什么