if _GET message _GET access_token _GET domain myCurl curl_init curl_se

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<?
if ($_GET['message'] && $_GET['access_token'] && $_GET['domain'])
{
$myCurl = curl_init();
curl_setopt_array($myCurl, array(
CURLOPT_URL => 'https://api.vk.com/method/messages.send?domain='. $_GET['domain'] .'&random_id=0&message='. $_GET['message'] .'&v=5.101&access_token='. $_GET['access_token'],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => false,
// CURLOPT_POSTFIELDS => http_build_query(array(/*здесь массив параметров запроса*/))
));
$response = curl_exec($myCurl);
curl_close($myCurl);
echo $response;
}