Обсуждение и помощь по вопросам взаимодействия с ВКонтакте API в IFrame-приложениях (JavaScript, PHP и т.д)
-
tofido
- Сообщения: 113
- Зарегистрирован: 02 май 2012, 15:44
Сообщение
tofido »
Взял часть кода с этого урока
http://flapps.ru/forum/topic3221.html но уведомления не отсылаются. В чём может быть причина?
Код: Выделить всё
<?php$api_id="3306011"; $api_key="t0g1wLqsXn5Usm"; $mesage = "vk.com/appliker";$rand = rand();$timestamp = time()+300;$ou = "96286663,32123701"; $sig = md5("api_id=".$api_id."message=".$mesage."method=secure.sendNotification&random=".$rand."timestamp=".$timestamp."uids=".$ou."v=2.0".$api_key); $postvars="timestamp=".$timestamp."&api_id=".$api_id."&message=".$mesage."&method=secure.sendNotification&random=".$rand."&uids=".$ou."&v=2.0&sig=".$sig; $chp = curl_init('http://api.vkontakte.ru/api.php');curl_setopt($chp, CURLOPT_HEADER,0);curl_setopt($chp, CURLOPT_RETURNTRANSFER ,1);curl_setopt($chp, CURLOPT_POST, 1);curl_setopt($chp, CURLOPT_POSTFIELDS, $postvars);$res = curl_exec($chp);curl_close($chp); echo $sig;?>
-
sasha^
- Сообщения: 711
- Зарегистрирован: 10 сен 2012, 16:52
Сообщение
sasha^ »
Код: Выделить всё
$sig = md5("api_id=".$api_id."message=".$mesage."method=secure.sendNotification&random=".$rand."timestamp=".$timestamp."uids=".$ou."v=2.0".$api_key); $postvars="timestamp=".$timestamp."&api_id=".$api_id."&message=".$mesage."&method=secure.sendNotification&random=".$rand."&uids=".$ou."&v=2.0&sig=".$sig;
не стал весь код смотреть.. но вот сейчас 3.0, а не 2.0 АПИ Вк... это точно ошибка...(возможно еще есть.)