I've written PHP code to set a deadline date by admin, so the admin enters the deadline date via form and it will store it in the database. Now I want to use this deadline to check whenever the user wants to access a page. If the deadline date expired the user can't access this page it will move them automatically to a page called "closed.html", if not the user can access it .. I've tried this code but it keeps moving me to closed.html page even when the date has not expired yet! Ideas please?
<?php
session_start();
$Load=$_SESSION['login_user'];
$sql= "Select deadline from schedule_deliverables";
$deadline = mysql_query($sql);
$todays_date = date("Y-m-d");
$today = strtotime($todays_date);
$expiration_date = strtotime($deadline);
if ($expiration_date > $today) {
echo "<meta http-equiv='refresh' content='1;URL=Check_file.php'>"; //user can access the page
} else {
echo "<meta http-equiv='refresh' content='1;URL=closed.html'>"; //deadline is past user can't access
}
?>