Answer the question
In order to leave comments, you need to log in
How to get GET data after a trellis?
Hello.
It is necessary to get the GET-data field of the lattice.
Link example: site.ru#data1=test&data2=test2
How can I find out what parameters are in this link using php?
$_GET, $_REQUEST, $_SERVER['QUERY_STRING'] - empty
Answer the question
In order to leave comments, you need to log in
1. This is not get data. It's called a "fragment"
2. Browsers don't send a fragment to the server, so there's basically no way to fetch it in the puff.
3. You can get a fragment in JS and send it to the server with an AJAX request.
4. Or use JS to create a new url and redirect to it.
5. A fragment in this format is usually intended to be processed by JS.
У вас запрос не правильный поэтому и не получаете ничего. Нужно запрос делать не через # , а через ? . Т.е должно быть site.ru?data1=test&data2=test2 , а не site.ru#data1=test&data2=test2 .
Также с помощью yii2 можно получить параметры через функцию Yii::$app->request->get() или Yii::$app->request->get('data1') - получите то что в data1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question