Whether a get value can be applied to multiple pages, for example: page a uses the url link get to pass the value to page B. Page B is correct. However, clicking a link under page B will jump to Page c. Page c also needs the get value of page a, but click Page B. the get value disappears after the link, no. How can we solve this problem? Can a get value be applied to multiple pages?
For example:
Page a uses the url link get to pass the value to page B. Page B is correct.
However, clicking a link under B will jump to Page c and the get value of page a will be required. However, after clicking the link on page B, the get value disappears and cannot be found. How can this problem be solved?
Reply content:
Can a get value be applied to multiple pages?
For example:
Page a uses the url link get to pass the value to page B. Page B is correct.
However, clicking a link under B will jump to Page c and the get value of page a will be required. However, after clicking the link on page B, the get value disappears and cannot be found. How can this problem be solved?
Solution 1:
You can add $ _ GET ['xx'] At the link of page B. If you want to jump from page A to page B with parameters, then the link to page B will inevitably include the $ _ GET ['xx'] parameter. this is when you click the link to jump to the C page, you can accept the parameters just from A-> B.
Solution 2:
Use SESSION or COOKIE to store $ _ GET ['xx'] parameters on page B, and read SESSION or COOKIE on Page C to obtain parameters.
When generating the HTML of page B, you can add the parameters passed by A to the URL. in simple words, you can perform the following operations:
">Page C
Another way is to store the variable in the session.
$param = parse_url( $_SERVER['HTTP_REFERER'] );list($key, $val) = explode('=', $param['query']);
You can consider using session. Based on your needs, the page opened through a hyperlink belongs to the same session...
I feel like it is a solution. Can you describe the requirements? That is to say, why.
Yes. You can use session or url-based stitching.