Exemplo n.º 1
0
<?php

session_start();
$file = 'story.txt';
$code = $_SESSION['code'];
if ($_POST['captcha_code'] == "" || $_POST['captcha_code'] == " ") {
    die("Введіть символи!");
} else {
    $p_code = $_POST['captcha_code'];
    if ($p_code != $code) {
        echo '<script>window.location = "http://overheard.in.ua/add.php";</script>';
        exit("Невірно введені символи!");
    } else {
        include "post.php";
        $access_token = "c0464bb95a9bf9826ed125490738b4513ca70c2bb6032f6a1939d5e1e867460ee863b18aa947466955352";
        $user_id = "-98624211";
        $vk = new Model_Vk($access_token);
        $text1 = file_get_contents($file);
        $params = array("owner_id" => $user_id, "from_group" => "1", "message" => $text1, "attachments" => "http://www.overheard.in.ua");
        file_put_contents($file, '');
        $post = $vk->method("wall.post", $params);
        echo '<script>alert("Повідомлення відправлено на модерацію");window.location = "http://overheard.in.ua/";</script>';
        //Тут делаем все что должно быть,
        //если капча введена верно
    }
}
?>