git clone https://git.videolan.org/git/x264.git
open -a Xcode x264.h
и ... вы просто посмотрите, как тут подробно описывается каждый метод. Зачем вам документация, если она прямо там: mysqli_query($link, "INSERT INTO 'users' ('firstname', 'lastname')
VALUES (' ".$_POST['firstname']." ',' ".$_POST['lastname']." ')");
mysqli_close($link);
<?php
// Get cURL resource
$ch = curl_init();
// Set url
curl_setopt($ch, CURLOPT_URL, 'https://api.vk.com/method/messages.send');
// Set method
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
// Set options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Set headers
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/x-www-form-urlencoded; charset=utf-8",
]
);
// Create body
$body = [
"message" => "",
"user_id" => "",
"access_token" => "",
"v" => "5.73",
];
$body = http_build_query($body);
// Set body
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
// Send the request & save response to $resp
$resp = curl_exec($ch);
if(!$resp) {
die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
} else {
echo "Response HTTP Status Code : " . curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo "\nResponse HTTP Body : " . $resp;
}
// Close request to clear up some resources
curl_close($ch);
function send($id , $message)
{
$url = 'https://api.vk.com/method/messages.send';
$params = array(
'user_id' => $id, // Кому отправляем
'message' => $message, // Что отправляем
'access_token' => '0000000000000000000000000000', // access_token можно вбить хардкодом, если работа будет идти из под одного юзера
'v' => '5.37',
);
// В $result вернется id отправленного сообщения
$result = file_get_contents($url, false, stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($params)
)
)));
}