I am very new to programming and i am trying to make a simple membership login page. However after trying for nearly 2 days now to get my code working accurately and trying multiple different methods i have finally come to a standstill and so i am here seeking advice.
i have used a very simple code to try and achive this. it seems to work if i use if ($now = $memberenddate) - but it does not work correctly and throws a false positive if i try to use if ($now > $memerenddate)
I am not sure why it is throwing this false positive but i am assuming it maybe because of the timestamps differing.
My final code attempts to match this however it is still giving me a false positive.
here is the code, please excuse any indentation.
$memberenddate = date('d.m.Y', strtotime($memberdate. '+ 7 days'));
$now = date('d.m.Y');
if ( $now > $memberenddate ) {
include "./login/connection.php";
$sql5 = "UPDATE `users` SET `member` = '0' WHERE email = '$email' ";
$conn5=$db->prepare($sql5);
$conn5->execute(array());
$membermessage="You Are Not a Member"; $memberenddate = "CLICK & BUY A MEMBERSHIP!!!";
}
i have tried multiple veriations of the code but nothing has seemed to get me the results i need, including trying to match the timestamp.
$today = $now = date('d.m.Y');
$now = date('d.m.Y', strtotime($today. '+ 0 days'));