function cmtx_current_page() { //gets the URL of the current page $url = cmtx_url_decode('http' . (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 's' : '') . '://' . strtolower($_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI']); return $url; }
} else { //if time submitted if (time() - intval($_POST['cmtx_time']) < 1) { //if user took less than 1 second to submit form cmtx_error(CMTX_ERROR_MESSAGE_MIN_TIME); //reject user for taking less than 1 second } } } /* Check Referrer */ if (cmtx_setting('check_referrer')) { if (isset($_SERVER['HTTP_REFERER'])) { //if referrer available $cmtx_referrer = cmtx_url_decode($_SERVER['HTTP_REFERER']); //get referrer $cmtx_domain = cmtx_url_decode(cmtx_setting('site_domain')); //get domain if (!stristr($cmtx_referrer, $cmtx_domain)) { //if referrer does not contain domain cmtx_error(CMTX_ERROR_MESSAGE_INCORRECT_REFERRER); //reject user for incorrect referrer } } else { cmtx_error(CMTX_ERROR_MESSAGE_NO_REFERRER); //reject user for no referrer } } /* Flood Control Delay */ if (cmtx_setting('flood_control_delay_enabled') && !$cmtx_is_admin) { //if 'flood control delay' enabled and user is not admin cmtx_flood_control_delay();