Bond007
Bond007

Reputation: 11

Hash Url Extract to php

I want to be able to get hash parameters variable from client side URL and send to server and store in session for echo later in php

URL format in client side Browser:

domain.com/Betatest/#response_uri=https%3a%2f%2flogin.online.com%2ferror%3fcode%3d700AB8&state=email%40domain.com

I want to get the variable of state which is email%40domain.com encoded and uncoded means [email protected]

I want to get the variable and save to session then echo later the variable using php

Upvotes: 1

Views: 94

Answers (1)

ADyson
ADyson

Reputation: 61904

Hash values are not sent to the server in a HTTP request. You need to put your data in the querystring, not hash, e.g.

domain.com/Betatest/?response_uri=https%3a%2f%2flogin.online.com%2ferror%3fcode%3d700AB8&state=email%40domain.com

That will give you two parameters (response_uri and state) which you can find in the PHP $_GET array, e.g. $_GET["response_uri"] and $_GET["state"]

Upvotes: 2

Related Questions