<?php if (isset($_POST['entry'])) { include_once '/db/DBController.php'; include_once '/log/Logger.php'; include_once 'plain.php'; $logger = new Logger('Add.php'); $logger->info('Request to add a new entry received.'); try { $db = new DBController(); echo @$db->addEntry($_POST['entry']); $logger->info('Added new entry: ' . $_POST['entry']); } catch (Exception $e) { echo 0; } }