i've write a php code to set a deadline date by admin , so the admin enter the daedline date via form and it will store in the database , now i want to use this deadline to check whenever the user want to access a page , if the deadline date expired the user can't access this page it will move him automatically to page called " closed.html" , if not the user can access it .. i've tried this code but it keep move me to closed.html page even when the date 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
}
?>