I want to change what appears on hoge.com/hoge by retrieving information from the previous page or dynamically using some method.
Example
hoge.com/hoge/1
hoge.com/hoge/2
hoge.com/hoge/3
hoge.com/hoge/4
Visit ↓
hoge.com/hoge
↓Change
Obtain and view the contents of hoge.com/hoge from the previous page.
javascript php html html5
I think the HTTP Header contains the URL of the previous page as the Referer.(Some sites are taking action such as leaving the Referer blank for security reasons, but if it's your site, you should be able to use Header containing the Referer information.)
When you visit hoge.com/hoge, I think it is possible to collect the Referer information (the URL of the previous page) from the HTML Header, and then access it to reflect the information collected on the page.
It's going to be a little complicated because the server needs to detect and deal with certain URLs.
==
I don't know the specific functions required, so this is a very rough answer, but I think the information in the Referer is easy to use.
There are many ways.
location.search
on the post-transition page to change the contentRefer
header
© 2024 OneMinuteCode. All rights reserved.