$login_stat=0; $redirect=$_GET[redirect]; if($_POST[action]=='login'){ $username = trim(stripslashes($_POST['username'])); $password = trim(stripslashes($_POST['password'])); if(empty($redirect)) $redirect="/"; $login_stat=Login($username, $password); if(!$login_stat){ if(empty($redirect)) header('Location: http://'.getenv('HTTP_HOST').'/forum'); else header('Location: http://'.getenv('HTTP_HOST').$redirect); $send_headers_flag=true; ob_flush(); exit(0); } } ?>