Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get a # from a url in php

Tags:

php

facebook

get

I'm trying to code with the facebook API

here it says : http://developers.facebook.com/docs/authentication/javascript to get the access_token thing, but it's after a # and not a ?

so how can I get it ?

http://www.example.com/callback#access_token=...&expires_in=...

like image 376
David 天宇 Wong Avatar asked Mar 06 '26 01:03

David 天宇 Wong


1 Answers

You won't be able to do it in PHP - you can only access it in javascript - the fragment/hash never reaches the server, it is processed by the browser

in Javascript, you can access the fragment using

window.location.hash
like image 77
Alex C Avatar answered Mar 08 '26 15:03

Alex C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!