GET变量中的值在页面加载时丢失


value in GET variable Lost on page load

GET变量中的值在页面加载时丢失,我想长时间存储GET变量值,这样它只更改来自查看页面的请求

帮助我如何将Value存储在$_GET[]中,除非它在请求时发生更改

        function get_data($limit,$offset )
        {
    //$type = $this->input->post('data');

    $this->db->select('S_Name,P_Name,P_Price');
    //$this->db->from();
    $this->db->join('item_info', 'P_Id = I_ProductId ');
    $this->db->join('order_info', 'I_OrderId = O_Id');
    $this->db->join('shops_info', 'O_ShopId = S_Id');
    $this->db->where('S_Id',$_GET['shopId']);
    $query = $this->db->get('product_info',$limit,$offset);
    return $query->result();    
}

如果您想存储它以备以后重新加载页面,我会使用会话。您可以在开始时将$_GET变量分配给会话,然后使用它执行您想要的操作。

<?php
session_start();
if(isset($_GET['shopId'])){
$_SESSION['shopId'] = $_GET['shopId'];
}