strtotime($times) 时间戳
$_POST[times] 表单里面填写的是20130525100000
如何让他提交到数据库是1369447200 时间戳我做了一个预约挂号程序,里面可以指定预约时间,提交表单格式为20130525100000 这种类型的,如何让他提交之后变成 1369447200 这种时间戳类型的呢?
$_POST[times] 表单里面填写的是20130525100000
如何让他提交到数据库是1369447200 时间戳我做了一个预约挂号程序,里面可以指定预约时间,提交表单格式为20130525100000 这种类型的,如何让他提交之后变成 1369447200 这种时间戳类型的呢?
解决方案 »
- php5 + iis6 + mysql5.2 导致的在打开网页时,库中读取的汉字为乱码2?24????????????
- 急 一段代码 高手看下 新手求助
- php ldap 取得ou结构 问题
- 多表查询之后如何应用结果?
- 在IIS如何配置PHP,才能在IE里运行?
- Mysql怪问题 帮忙解决的高分相送
- 很好拿的分,只是我不会(如何新建一个文件),在线等。。。。。
- phped 2.95 的问题
- 大家好,我在这里问在家一个问题,关于sql sever2000 可不可以和PHP连接,还有要设置什么东东,和相关函数。谢谢
- form中参数传递不出去,急
- 求大家推荐两本书
- 入不了数据库!代码有问题吗?各位看看!
<?php
include("conn.php");
if($_POST['submit'])
{
$sql="INSERT INTO `pinphp`.`ftxia_items` (`id`, `coupon_start_time`, `coupon_end_time`)" .
"values ('NULL','$_POST[coupon_start_time]','$_POST[coupon_end_time]')";
mysql_query($sql);
echo "";
}
$times='20130525100000';
echo strtotime($times);
?>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style>
<form name="myform" action="add.php" method="post" onsubmit="return checkpost();">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr>
<td width="79" height="34" align="center" bgcolor="#FFFFFF">ordid:自定义排序999</td>
<td width="518" bgcolor="#FFFFFF"><input name="ordid" type="ordid" id="ordid" size="40" />
</label></td>
</tr> <tr>
<td height="43" align="center" bgcolor="#FFFFFF">coupon_start_time:开始时间</td>
<td height="43" bgcolor="#FFFFFF"><input name="coupon_start_time" type="coupon_start_time" id="coupon_start_time" size="40" /></td>
</tr>
<tr>
<td height="43" align="center" bgcolor="#FFFFFF">coupon_end_time:结束时间</td>
<td height="43" bgcolor="#FFFFFF"><input name="coupon_end_time" type="coupon_end_time" id="coupon_end_time" size="40" /></td>
</tr> <tr>
<td height="55" colspan="2" align="center" bgcolor="#FFFFFF"><label>
<input type="submit" name="submit" id="button" value="提交">
</label></td>
</tr>
</table>
</form>
代码