<?php
$DB_HOST = "localhost";
$DB_NAME = "deltaweb_wood-system";
$DB_USER = "deltaweb_wood-system";
$DB_PASS = "deltaweb_wood-system";
$charset = "utf8mb4";
$options = [
  PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
  PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
  PDO::ATTR_EMULATE_PREPARES => false,
];
try {
  $pdo = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME;charset=$charset",$DB_USER,$DB_PASS,$options);
} catch(PDOException $e){
  die("DB fail: ".htmlspecialchars($e->getMessage()));
}
function post($k,$d=null){return $_POST[$k]??$d;}
function getv($k,$d=null){return $_GET[$k]??$d;}
function go($u){header("Location: $u");exit;}
?>