Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // client_id, access_token, user_id указываю валидные
- // По ссылке щелкаю, получаю токен, потом его копирую в курл.
- echo '<a href="https://oauth.vk.com/authorize?client_id=client_id&scope=friends&display=page&response_type=token&redirect_uri=https://oauth.vk.com/blank.html">https://oauth.vk.com/blank.html</a>';
- $ch = curl_init( 'https://api.vk.com/method/friends.add?access_token=access_token');
- curl_setopt ( $ch, CURLOPT_HEADER, false );
- curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
- curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false );
- curl_setopt ( $ch, CURLOPT_POST, true );
- curl_setopt ( $ch, CURLOPT_POSTFIELDS, 'user_id=user_id' );
- $data = curl_exec($ch);
- curl_close($ch);
- print_r ($data);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment