Skip to content
Snippets Groups Projects
admin.php 332 B
Newer Older
Giildo's avatar
Giildo committed
<?php

require_once __DIR__ . '/../db/Database.php';

$db = new Database();
$result = $db->insertGame(
    $_POST['name'],
    $_FILES['picture'],
    $_POST['description'],
    $_POST['price'],
    $_POST['releaseDate'],
);

if ($result) {
    header('Location: /index.php');
} else {
    header('Location: /admin.php?error=1');
}