Example #1
0
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);
include_once 'database.php';
$database = new Database();
// echo "string";
//todo: Make it so there is only one of a brick and if a user posts a brick with the same one it will give a link to the brick
if (empty($_POST['hidden'])) {
    // $global $output;
    $brickTitle = $_POST['brickTitle'];
    $brickContent = $_POST['brickContent'];
    $database->addBrick($brickTitle, $brickContent);
    $output = "We have inserted your brick";
    header("Location: ../index.php");
} else {
    $output = "We do not accept bots";
}
// }