public static function get() { $form = f::dbFirstRow("select enabled_domains, detail \n\t\t\t\t\t\tfrom fm_forms \n\t\t\t\t\t\twhere id = {p:form_id} \n\t\t\t\t\t\tand client_id = {p:client_id} \n\t\t\t\t\t\tand (available_from = '' or available_from <= curdate()) \n\t\t\t\t\t\tand (available_to = '' or available_to >= curdate()) \n\t\t\t\t\t\tand status = 1"); if (!$form) { f::setError(400, "Form not found"); } else { if (!self::checkDomain($form)) { f::setError(400, "Hostname not allowed"); } } if (f::hasErrors()) { return; } $formDetail = json_decode($form["detail"], true); $uniqId = sha1(uniqid()); $captcha = f::getCaptcha(); f::setResponseJson(array("id" => $uniqId, "captcha" => $captcha, "form" => $formDetail)); }