<?php

require_once('config/config.php');
require_once("foo/functions.php");
dbconnect();
session_start();

if ($_SERVER['REQUEST_METHOD'] === 'POST') {

	if (code3_check($_POST['code'], get_code3($_SESSION['user_acc']))) {
		log_info($_SERVER['REMOTE_ADDR'], $_SESSION['user_login'], $_SESSION['user_acc'], 'Transfer attempt correct '.CODE3_NAME.'');
		redirect('validating.php');
	}
	else {
		redirect('validate.php?error=' . urlencode('Invalid '.CODE3_NAME.''));
	}
}

?>