我正在尝试为一个月后(2419200秒)在我的网站上购买会员资格的用户自动过期
但是,当我更改行的日期时,它似乎不起作用。我试过在不同的区域包装时间函数,甚至禁用它,但我似乎对它的工作有问题。
buyDate参数是我的SQL数据库中对象的一部分。(unix时间整数)如有任何帮助,将不胜感激。
<?php
if(time($membershipExpire->buyDate) <= time($membershipExpire->buyDate + 2419200)){
die("Your membership has expired. Please contact someone to remove your membership in order to continue playing.");
}
?>发布于 2020-07-06 10:49:57
重写它的方式略有不同
<?php
$end = $membershipExpire->buyDate + 2419200;
if(time() >= $end)
{
die("Your membership has expired. Please contact someone to remove your membership in order to continue playing.");
}
?>我还注意到,当前时间必须大于endtime,而在您的原始代码中,您使用的是小于符号。
还有一件与代码无关的事情。您的错误消息显示:“您的会员资格已过期。请联系其他人删除您的会员资格,以便继续播放。”
不是应该是“续签会员资格”吗?
https://stackoverflow.com/questions/62748276
复制相似问题