Помощь по скриптам | ошибка 15
если что код скину....
DELETED
24 сентября 2016, в 20:28
Delete
shadrvlad (24.09.2016 в 20:28)
kolyan_[vip] , так смотри что за 15 ошибка
kolyan_[vip] , так смотри что за 15 ошибка
там чот тип нет доступа и тд
DELETED
24 сентября 2016, в 20:30
Delete
<?
function api($url, $post = null){
return json_decode(curl($url,$post),1);
}
function curl($url, $post = null){
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417
Firefox/3.0.3');
if($post){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
$response = curl_exec( $ch );
curl_close( $ch );
return $response;
}
/////////////////////////////////////////////////////////////
$login='номер телефона';
$password='пароль';
$client_secret='секретний код';
$client_id='ид приложения';
$redirect_uri='http://vk.firesoc.ru/index.php';
////////////////////////////////////////////////////////////
$params = array(
'client_id' => $client_id,
'redirect_uri' => $redirect_uri,'display' => 'mobile','scope' => 'offline,wall,groups,manage',
'response_type' => 'code'
);
echo '<a href="https://oauth.vk.com/authorize?'.urldecode(http_build_query($params)).'">code new start</a>';
if(isset($_GET['code'])){
$code= $_GET['code'];
$res=api("https://oauth.vk.com/access_token?client_id=".$client_id."&client_secret=".$client_secret."&redirect_uri=".$redirect_uri."&code=".$code."");
$token = $res['access_token'];
echo $token.'<br>';
//66309064
$text='5555555';
$g = api("https://api.vk.com/method/wall.post?message=".$text."&owner_id=-66309064&access_token=".$token);
print_r ($g);
}
?>
function api($url, $post = null){
return json_decode(curl($url,$post),1);
}
function curl($url, $post = null){
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417
Firefox/3.0.3');
if($post){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
$response = curl_exec( $ch );
curl_close( $ch );
return $response;
}
/////////////////////////////////////////////////////////////
$login='номер телефона';
$password='пароль';
$client_secret='секретний код';
$client_id='ид приложения';
$redirect_uri='http://vk.firesoc.ru/index.php';
////////////////////////////////////////////////////////////
$params = array(
'client_id' => $client_id,
'redirect_uri' => $redirect_uri,'display' => 'mobile','scope' => 'offline,wall,groups,manage',
'response_type' => 'code'
);
echo '<a href="https://oauth.vk.com/authorize?'.urldecode(http_build_query($params)).'">code new start</a>';
if(isset($_GET['code'])){
$code= $_GET['code'];
$res=api("https://oauth.vk.com/access_token?client_id=".$client_id."&client_secret=".$client_secret."&redirect_uri=".$redirect_uri."&code=".$code."");
$token = $res['access_token'];
echo $token.'<br>';
//66309064
$text='5555555';
$g = api("https://api.vk.com/method/wall.post?message=".$text."&owner_id=-66309064&access_token=".$token);
print_r ($g);
}
?>