'', 'status' => $httpResponseCode ); ## break here secret empty or false if($_create === false) { header('X-PROVIDED-BY: scientia'); header($contentType); http_response_code($httpResponseCode); echo json_encode($contentBody); exit(); } ## DB connection $DB = new mysqli(DB_HOST, DB_USERNAME,DB_PASSWORD, DB_NAME); if ($DB->connect_errno) exit('Can not connect to MySQL Server'); $DB->set_charset("utf8mb4"); $DB->query("SET collation_connection = 'utf8mb4_bin'"); $driver = new mysqli_driver(); $driver->report_mode = MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT; require_once 'lib/entry.class.php'; $Entry = new Entry($DB); $do = $Entry->create($filteredData); if(!empty($do)) { $contentBody['message'] = INSTALL_URL . PATH_WEBROOT . date('/Y/m/d/').$do; } else { $hash = md5($do.time()); error_log("[ERROR] $hash Can not create. ". var_export($do,true)); $contentBody['message'] = "Something went wrong. $hash"; $contentBody['status'] = 500; } # return header('X-PROVIDED-BY: scientia'); header($contentType); http_response_code($httpResponseCode); echo json_encode($contentBody); $DB->close();