Reputation: 1146
me jQuery generate url:
location.hash = "parameter1=DEF¶meter2=XYZ";
//www.example.com#parameter1=DEF¶meter2=XYZ
How to read this parameter1 and parameter2 in PHP
Upvotes: 0
Views: 91
Reputation: 9024
You can by using parse_url
For e.g
$url = 'http://google.com#anchor';
print_r(parse_url($url));
Will give you
[fragment] = anchor
Upvotes: 1
Reputation: 2998
Your javascript is client-side and your PHP is server-side, so it's not possible.
You should rethink your application or use Ajax to send data from Javascript to PHP: https://api.jquery.com/jquery.ajax/
Upvotes: 1