Decode
20-08-2008, 12:23 PM
Ive made a function to unban an acount from my usersystem automaticly, when they login on a banned account this function executes (ive removed the getting the unban time from the database from the top and replaced it with $date so its eaysier to understand)
$date = "21/08/2007 14:38";
$datetime = explode(" ", $date);
$timeexplode = explode(":", $datetime['1']);
$dateexplode = explode("/", $datetime['0']);
$dateday = date("d");
$datemonth = date("m");
$dateyear = date("Y");
$timehour = date("G");
$timemin = date("i");
function unban()
{
//unban function
echo "unbanned";
}
if ($dateyear >= $dateexplode['2']) {
if ($datemonth >= $dateexplode['1']) {
if ($dateday >= $dateexplode['0']) {
if ($timehour >= $timeexplode['0']) {
if ($timemin >= $timeexplode['1']) {
unban();
}
}
}
}
}
?>Ive been looking for an error for about 20 minutes but I can't find one +rep if someone can help me :)
Moved by Invent (Forum Moderator) from Designing & Development: Please post in the correct forum next time, thanks :).
$date = "21/08/2007 14:38";
$datetime = explode(" ", $date);
$timeexplode = explode(":", $datetime['1']);
$dateexplode = explode("/", $datetime['0']);
$dateday = date("d");
$datemonth = date("m");
$dateyear = date("Y");
$timehour = date("G");
$timemin = date("i");
function unban()
{
//unban function
echo "unbanned";
}
if ($dateyear >= $dateexplode['2']) {
if ($datemonth >= $dateexplode['1']) {
if ($dateday >= $dateexplode['0']) {
if ($timehour >= $timeexplode['0']) {
if ($timemin >= $timeexplode['1']) {
unban();
}
}
}
}
}
?>Ive been looking for an error for about 20 minutes but I can't find one +rep if someone can help me :)
Moved by Invent (Forum Moderator) from Designing & Development: Please post in the correct forum next time, thanks :).