Rossi are you in college for Computer Science or something? If so, don't pay to have the code done, instead why don't you use the forums to help you learn how to do it yourself?
Ablaye, I'm not trying to take away your business or anything, but I think the PHP section is suppose to be where we can learn from eachother, right? If it is for a gig I think it should be posted in the wanted section.
So, Rossi, I was thinking that one way of going about this is to hold a session variable maybe called penalty that you would hold the time they are out of the penalty. Lets call the page "set-penalty.php"
Code:
<?php
session_start();
$minutes = 1;
$_SESSION['penalty'] = time() + ( $minutes * 60 );
header( 'location:check-penalty.php' );
exit();
?>
So now you have a session variable that holds the current time plus the amount of penalty, so then we go to the "check-penalty.php" page
Code:
<?php
session_start();
if( isset( $_SESSION['penalty'] ) ) {
if( $_SESSION['penalty'] < time() ) {
//they served their time remove penalty
unset( $_SESSION['penalty'] );
} else {
//still in penalty send them to jail
header( 'location: jail.php' );
exit();
}
}
header( 'location: action.php' );
exit();
?>
First of all we check if a penalty session exists. If it does exist then we compare the time of the penalty variable with the current time. If the penalty time has expired we get rid of the penalty session variable. If they are still in the penalty then we send them to jail or whatever you wish to do. So now at the end of the page it means either they never had a penalty or their penalty is expired so you do your action there.
I am not sure how or if this will fit into your game, but I sure hope you can get some use out of it.
Cheers!