Can a get value be used on multiple pages?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.