<?php

	

	$target_dir = "vphoto/";
	$fname = time();

	$fname_face = "vphoto/".$fname."_face.png";
	$fname_id = "vphoto/".$fname."_id.png";
	$fname_form = "vphoto/".$fname."_form.png";



	$data_face = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $_POST['faceimgdata']));
	file_put_contents($fname_face, $data_face);


	$data_id = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $_POST['idimgdata']));
	file_put_contents($fname_id, $data_id);



	$data_form = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $_POST['formimgdata']));
	file_put_contents($fname_form, $data_form);
	

	include('dbconfig.php');
	include('dbconnect.php');

	addlog($mysqli, $_POST, $fname . "_face.png", $fname . "_face.png", $fname . "_form.png");
	header("Location:main_desktop.php");
	exit;




?>