1

I request a instagram api access token and it return and url with the token ,something like that http://localhost/pruebainst/pruebas.php#access_token=MY_TOKEN. My question is how I can get this token of the url to store it on a variable to use it?It is not on $_GET OR $_POST.

Cœur
  • 37,241
  • 25
  • 195
  • 267
AFS
  • 1,433
  • 6
  • 28
  • 52

1 Answers1

0

You cannot use php or other server-side code to get hash fragment in URL. You have to use javascript

var access_token = window.location.hash.split('access_token=')[1];
krisrak
  • 12,882
  • 3
  • 32
  • 46