Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Need to have the vk.php in the same directory.
- include 'vk.php';
- // Please complete the below with your details/credentials.
- $config['secret_key'] = '';
- $config['client_id'] = '';
- $config['user_id'] = '';
- $config['access_token'] = '';
- $config['scope'] = 'wall,photos,friends,groups';
- // Get a new instance of VK.
- $v = new Vk($config);
- // Define the attachment to insert, in this case an image.
- $attachments = $v->upload_photo(0, array('1737759.jpg'));
- // Post the message and image to your wall.
- $response = $v->wall->post(array(
- 'message'=>'test 1737759.jpg',
- 'attachments' => implode(',', $attachments)
- ));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement