Mam taki oto kawałek kodu, który po poprawnym logowaniu utwarza sesję, ale jak zmodyfikować ten oto kod żeby dodać taki warunek, że utworzy się ona tylko wtedy gdy checkbox id abc name abc jest zaznaczony?
CODE
// Check username and password
if($post_email == $config['email'] && $post_password == $config['password'])
{
// No error? Register the session & redirect the user to 'Control Panel'
$_SESSION['username'] = $post_email;
if($_POST['remember_me'])
{
// Set the cookies for 1 month
setcookie ("remember_me", true, (time() + TIME_DIFF) + (3600 * 24 * 30));
setcookie ("info", $user_id.','.md5($password), (time() + TIME_DIFF) + (3600 * 24 * 30));
}
echo 'OK';
}
if($post_email == $config['email'] && $post_password == $config['password'])
{
// No error? Register the session & redirect the user to 'Control Panel'
$_SESSION['username'] = $post_email;
if($_POST['remember_me'])
{
// Set the cookies for 1 month
setcookie ("remember_me", true, (time() + TIME_DIFF) + (3600 * 24 * 30));
setcookie ("info", $user_id.','.md5($password), (time() + TIME_DIFF) + (3600 * 24 * 30));
}
echo 'OK';
}