This depends on the current format of the dates. Are they stored in a database? What format are they?
Database format could be
2010-12-24 (mysql date)
2010-12-24 09:59:00 (mysql date-time)
1293184922 (unix timestamp)
In order to compare that date with the current date you need to make the formats similar.
In PHP you can convert the current date to the required format:
echo date("Y-m-d"); // displays 2010-12-24
echo date("Y-m-d h:m:s"); // displays 2010-12-24 09:59:00
echo time(); // displays 1293184922
So work out what your date to test format is and compare with the comparable php code.
<?php
$expires = '2010-12-24'; // date pulled from the database
if($expires < date("Y-m-d")) {
echo 'You are authorised to view this content';
} else if($expires == date("Y-m-d")) {
echo 'Your subscription expires today. You can view the content but please renew your subscription';
} else {
echo 'Sorry. Your subscription has expired. You are not allowed to view this page.';
}
?>
If your database format is different then you just need to modify the php code to match it.