Re: IPB post date check
| From: | Dan Shirah | Date: | Thu, 24 Jul 2008 15:40:27 +0000 |
| Subject: | Re: IPB post date check | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277244@lists.php.net to get a copy of this message | ||
Luca,
You said you have access to the board's DB, correct?
Just from looking at the link you provided I can see that somewhere in the
database it does store the date/time of each post. So, to meet your
conditions your query should be something simple like this:
//
$username = $_POST['user_name'];
$begin_date = "01/01/2001";
$end_date = "01/01/2008";
$register_before_date = "01/01/2008";
$query = "SELECT username,
register_date,
message_date
FROM table_1,
table_2
WHERE username = '$username'
AND message_date BETWEEN '$begin_date' AND '$end_date
23:59:59.997'
AND register_date <= '$register_before_date'"
Then get your result set...if it isn't empty, that user matches your
criteria and can access the forum. Or if you don't want an array you could
just do a SELECT COUNT and then assign the value to a variable and check
something like: if ($count > 0) { allow access }
Hope that helps.
Dan