<?php
if (!isset($_REQUEST)) {
return;
}
$txt;
$date;
$confirmation_token = '9081a5bb';
$token = 'c0223f775444cf3d58a8a1442ec76a9';
$data = json_decode(file_get_contents('php://input'));
switch ($data->type) {
case 'confirmation':
echo $confirmation_token;
break;
case 'wall_post_new':
$txt = $data->object->text;
$date = $data->object->date;
echo ('ok');
break;
}
require_once('bd.php');
update ($txt, $date);
<?php
function update ($txt, $date) {
$link = mysqli_connect("123.456.789.012", "u123456_call", "qwerty", "db123456_call") or die();
mysqli_set_charset($link, "utf8");
$query = "INSERT INTO `text`(`id`, `text`, `date`) VALUES (NULL,\"" . $txt . "\"," . $date . ")";
mysqli_query ($link, $query) or die();
mysqli_close($link);
}