session_start(); $log_denied = date( "d.m.y [H:i:s]" ) . " - " . gethostbyaddr( $REMOTE_ADDR ) . " ($username:$password)\n"; $log_granted = date( "d.m.y [H:i:s]" ) . " - " . gethostbyaddr( $REMOTE_ADDR ) . "\n"; $haslo["midday"] = "tepeliada"; if( $act == "logout" ) session_destroy(); if( $act == "check_user" ) { if( !empty($haslo[$username] ) && $haslo[$username]==$password ) { session_register( admin, $username ); session_name( "Administracja odlot.org" ); $uchwyt = fopen( "log_history.granted", "a" ); if ( !$uchwyt ) die( "błąd" ); fputs ( $uchwyt, $log_granted ); fclose( $uchwyt ); Header( "Location: main.php" ); } else { $denied = "access"; $uchwyt = fopen( "log_history.denied", "a" ); if ( !$uchwyt ) die( "Error" ); fputs ( $uchwyt, $log_denied ); fclose( $uchwyt ); }; }; if( !session_is_registered( "admin" ) ) { ?>