Answer the question
In order to leave comments, you need to log in
How to "catch" access token vk api via php?
There is a standalone VK application. I created a php script on the server, when I click on the button, it redirects me to the VK api page and access token is visible in the address bar of the browser. How to catch it? Now I just copy it with the mouse, but can I somehow write it through php, for example, immediately into a text file?
Answer the question
In order to leave comments, you need to log in
for standalone applications, the redirect parameter is not always available (limited only for certain types of permissions, such as posting on the wall),
but in general, you can use the redirect parameter when requesting a token, which tells which address to send the generated token to.
and yes, php will still not see it at the forwarded address, because the hashtag will be used in the link, after which the data is not sent to the server, in order to receive this data, you must use JS on the browser side, which will eventually send you this token)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question