UNIX_TIMESTAMP() EOQ ); $afd = substr($stamklas, 0, 2); if ($afd != '5H' && $afd != '6V' && $_SESSION['admin'] != 1) { do_logout(); error_system("permission denied, heel stout!"); } //if (!isset($_FILES['pasfoto'])) error_system("impossible"); if (isset($_FILES['pasfoto'])) { $pasfoto = $_FILES['pasfoto']; } else { $pasfoto = NULL; } if ($pasfoto && $pasfoto['tmp_name']) { $tmp_name = $pasfoto['tmp_name']; uploadcomplain($pasfoto); $sha256 = hash_file('sha256', $tmp_name); $new_filename = $data.$sha256; if (!move_uploaded_file($tmp_name, $new_filename)) error_system("unable to move uploaded file"); mdb2_exec($db, "INSERT INTO photos ( ppl_id, sha256, mimetype ) VALUES ( {$_SESSION['ppl_id']}, '$sha256', '%q' ) ON DUPLICATE KEY UPDATE sha256= '$sha256', mimetype = '%q'", $pasfoto['type'], $pasfoto['type']); } if (!$_POST['quote'] !== NULL || $_POST['toestemming'] !== NULL) { mdb2_exec($db, "INSERT INTO quotes ( ppl_id, quote, toestemming ) VALUES ( {$_SESSION['ppl_id']}, '%q', %i ) ON DUPLICATE KEY UPDATE quote = '%q', toestemming = %i", $_POST['quote'], ($_POST['toestemming'] == 'ja')?1:0, $_POST['quote'], ($_POST['toestemming'] == 'ja')?1:0); } //print_r($_POST); //exit; header('Location: '.dirname($_SERVER['PHP_SELF']).'/'); ?>