Whether a get value can be used on multiple pages

Source: Internet
Author: User
Keywords Php
Can a get value be applied to multiple pages
Such as:
Page A via URL link get pass value to b page B page no problem
But under B There is a link click and will jump to C page C page also need a page of the Get value but click on the B page link after the Get value disappears, can not find. How to solve this problem?

Reply content:

Can a get value be applied to multiple pages
Such as:
Page A via URL link get pass value to b page B page no problem
But under B There is a link click and will jump to C page C page also need a page of the Get value but click on the B page link after the Get value disappears, can not find. How to solve this problem?

Programme one:

你可以在B页面的链接添加$_GET['xx'],只要从A页面带参数跳转到B页面的话,那B页面的链接就必然会带上刚刚的$_GET['xx']参数.这是点击链接跳转到C页面也就可以接受刚刚从A->B的参数了.

Scenario Two:

在B页面使用SESSION或者COOKIE存储$_GET['xx']参数,在C页面通过读取SESSION或者COOKIE来获取参数.

When you generate the HTML for page B, you can add the arguments passed in a to the URL, which you can simply do:


  
   ">Page C

Another way is to consider the existence of variables in the session.

$param = parse_url( $_SERVER['HTTP_REFERER'] );list($key, $val) = explode('=', $param['query']);

You can consider using the session, according to your needs, the page opened through hyperlinks belong to the same session ...

The feeling describes a scenario, whether it can describe the requirements, that is, why.

Yes, you can use the session, or you can use the URL behind the stitching method

  • 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.