F
F
FootWork2014-08-13 20:06:11
PHP
FootWork, 2014-08-13 20:06:11

How to make authorization in vk.com using cURL?

//The cURL code was written here
. In short, use the vk API. It is very comfortable.
The authorization code for the standalone application is as follows:

$vk_client_id = ''; // ID приложения
$vk_client_secret = ''; // Защищённый ключ

VkAuth($vk_client_id);
function VkAuth($client_id)
{
  $url = 'https://oauth.vk.com/authorize';

  $params = array(
  'client_id' => $client_id,
  'scope' => 'offline group photos wall',
  'display' => 'page',
  'response_type' => 'token',
  'redirect_uri' => 'https://oauth.vk.com/blank.html',
  'v' => '5.24'
  );

  echo '<p><a href="' . $url . '?' . urldecode(http_build_query($params)) . '">Аутентификация</a></p>';
}

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sasha, 2014-08-13
@FootWork

there is an opinion that you are engaged in delirium. Even if you log in through the usual authorization of the vkontach, and even through the curl, then the hemorrhoids will not bother to make requests for simple things like CURL, GIVE ME THE USER AVATAR. because all vkontach requests go through ajax and dick knows what they transfer to the server there, well, of course you can reverse their code and understand how it works, in which I wish you good luck.
And therefore I recommend that you pay attention to their API. With it, you can do everything you want many times easier. https://vk.com/dev

D
Dmitry Skogorev, 2014-08-13
@EnterSandman

Wireshark in the teeth and see what goes where

A
Artem Lisovsky, 2014-08-13
@torrie

&

On the face of escaping characters in the place where you got it from.
Use tutorials. For example, this
Here everything is step by step with source codes

K
Kirill Batalin, 2014-08-13
@kir55rus

you can log in to VK through the mobile version, and then load pages through the regular one. For authorization, you need to parse the url from the m.vk.com page, to which the post-request will be sent (regex will help #<form method="post" action="([^"]+)"#iUs), and then send data to this url . Next, to find out where and what to send to work with the site, you can use the sniffer array('email'=>'[email protected]', 'pass'=>'123456')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question