Rahul K
Rahul K

Reputation: 11

How to get parameters from url after hash?

Need to get parameters after hash(#) just using PHP

https://app.edivo.io/alpha/1.0/callback.php#access_token=fdsfDRSgsfedfgwERvnfd

I want to get access_token=fdsfDRSgsfedfgwERvnfd from above url, only using PHP

Upvotes: 0

Views: 955

Answers (2)

MiK
MiK

Reputation: 913

Not possible from the adress bar itself, see:

https://stackoverflow.com/a/26944636/12020068

hashtag (#...) URL parts cant be detected from PHP (server-side). For that, use JavaScript.

Upvotes: 0

BhAvik Gajjar
BhAvik Gajjar

Reputation: 458

That part is called "fragment" and you can get it in this way:

$url=parse_url("Your URL");
echo $url["fragment"]; //This variable contains the fragment

In Java script

var type = window.location.hash.substr(1);

Upvotes: 3

Related Questions