Exemplo n.º 1
0
    writeln('	</tr>');
    writeln('</table>');
    writeln('</div>');
    writeln('</form>');
    writeln('</td>');
    writeln('</tr>');
    writeln('</table>');
    print_footer();
}
if (http_post()) {
    $title = http_post_string("title", array("len" => 100, "valid" => "[a-z][A-Z][0-9]`~!@#\$%^&*()_+-={}|[]\\:\";',./? "));
    $body = http_post_string("story", array("len" => 64000, "valid" => "[ALL]"));
    $tid = http_post_int("tid");
    $answer = http_post_string("answer", array("required" => false));
    $time = time();
    if (!captcha_verify($answer)) {
        die("captcha failed");
    }
    $topic = db_get_rec("topic", $tid);
    $title = clean_entities($title);
    $new_body = str_replace("\n", "<br>", $body);
    $new_body = clean_html($new_body);
    if (http_post("preview")) {
        print_submit_box($title, $body, $new_body, $tid, true);
        die;
    }
    $pipe = array();
    $pipe["pid"] = 0;
    $pipe["tid"] = $tid;
    $pipe["zid"] = $auth_zid;
    $pipe["editor"] = "";
Exemplo n.º 2
0
<?php

function captcha_verify($id)
{
    $ip = $_SERVER['REMOTE_ADDR'];
    $get = file_get_contents("http://captcha.one/captcha/verify/?method=captcha_verify&id={$id}&ip={$ip}");
    if ($get && ($get = @json_decode($get, true))) {
        if (isset($get['response']['verify']) && isset($_COOKIE[$id]) && $get['response']['verify'] && $_COOKIE[$id] == $get['response']['captcha_callback']) {
            return true;
        }
    }
    return false;
}
if (!captcha_verify('e6298e99ec4f0f84073e983387de9fc4')) {
    die('captcha_invalid');
} else {
    echo 'Form submitted Successfully. Check your email for the confirmation link.';
}
// $_POST['email']
Exemplo n.º 3
0
require "system/__init__.php";
/**
 * Session must be clean on this step
 */
if (!empty($_SESSION)) {
    session_unset();
    session_destroy();
}
/**
 * Handle form data
 */
if ($_POST) {
    $ukr_citizen = post_arg('ukr_citizen');
    $personal_data = post_arg('personal_data');
    $captcha_res = captcha_verify();
    $current_date = date('Y-m-d H:i:s');
    if (!$ukr_citizen) {
        append_error("Не підтверджена згода з правилами голосування.");
    }
    if (!$personal_data) {
        append_error("Немає згоди на обробку персональних даних.");
    }
    if (!$captcha_res) {
        append_error("Не пройдено тест на роботів!");
    }
    if ($current_date < $settings['open_elections_time']) {
        append_error("Вибори ще не розпочались.");
    }
    if ($current_date > $settings['close_elections_time']) {
        append_error("Вибори вже закінчились.");