Re: [PHP] IPB post date check



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


Relevant Pages

  • Re: form - request question
    ... Name your desired variables, loop through the $_POST/$_GET array, ... these names are used to build the query. ... column names in de database. ... you''d change the location or surrounding code of the script it could break. ...
    (alt.php)
  • Re: Can someone tell me what is wrong with this?
    ... > in checkboxes that if selected, will be then be used to select specific ... you're looping through each item in an array. ... If it is the result of a database ... query, is it perhaps an array of arrayrefs? ...
    (comp.lang.perl.misc)
  • Re: Count rows in dataset WHERE ...
    ... This will return an array of rows matching the ... things you can do in a database query, and it is certainly going to be far ... less efficient then a SQL engine that has query optimization, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Algorithm isnt working
    ... > supposed to connect to a database and perform a query to get all the ... What makes you so certain that the order in the $files array corresponds ... For each loop you should check for its presence in the ...
    (comp.lang.php)
  • Re: Multiple similar dropdowns -> 1 query
    ... >Hmm, could you maybe explain a little bit more? ... >times from 1 query ... ... $array is the array from the database and $sel is the selection you are ...
    (comp.lang.php)