<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

<?PHP
class Logger {
 
	protected $fh;
 
	public function __construct() {
		$this->fh = fopen('alleStimmen.txt', 'a+', "\n");
	}
 
	public function log($msg) {
		if(!$this->fh) {
			throw new Exception('Unable to open log file for writing');
		}
		if(fwrite($this->fh, $msg . "\n") === false) {
			throw new Exception('Unable to write to log file.');
		}
	}
 
	public function __destruct() {
		fclose($this->fh);
	}
}
$myarray = $_POST;
$logger = new Logger();
$logger->log(date('m-d-Y H:i:s') . ' ');
$space = '';
$logger->log('####################' . print_r($_POST, true) . '       ' . "\n");
//$logger->log('voted for:' . print_r($_POST, true));
//nl2br("\n");
//fwrite('blablabla\n');
//$logger->log('Time needed: ' . print_r($_POST, true));
//$logger->log('$_FILES: ' . print_r($_FILES, true));
nl2br("\n");
nl2br("\n");
?>
</body>
</html>
