Answer the question
In order to leave comments, you need to log in
Why doesn't wall.post stop working?
There is a code that takes a list of photos in an album and posts a random one on the wall. But the script does not stop and fasts many photos at once with an interval of about a minute. What's wrong?
<?php
$fpt = file_get_contents('https://api.vk.com/method/photos.get?owner_id=-1766&album_id=2629&count=1000&access_token=***&v=5.50');
$jjs = json_decode($fpt);
$jrnd = $jjs->response->count;
$jrnd = rand('0',$jrnd);
$pid = $jjs->response->items[$jrnd]->id;
file_get_contents('https://api.vk.com/method/wall.post?owner_id=-182&access_token=***&v=5.50&from_group=1&attachment=photo-1766_'.$pid);
?>
Answer the question
In order to leave comments, you need to log in
And you try at the end, when the script is executed, clear the variables. Maybe it will help, but I can't promise.
$fpt->free(); /*пример очистки переменной. способов много, но я пользуюсь им и всё работает.*/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question