我想這個陣列添加到我的笨會話變量:會話變量是第二頁(分頁)在笨的空
$formValues = $this->input->post(NULL, TRUE);
$fv = $this->session->set_userdata($formValues);
if (!$this->input->post(NULL, TRUE)) {
echo "false, post is null, get the session";
echo "<pre>";
print_r($fv);
echo "</pre>";
} else {
echo "true, use the post";
$formValues = $this->input->post(NULL, TRUE);
echo "<pre>";
print_r($formValues);
echo "</pre>";
}
print_r($formValues);
<pre>
Array
(
[addtypeid] =>
[isnew] =>
[orderby] =>
[geographicareaid] =>
[catid] => 1
[catid2] =>
[manufacturerid] =>
[modelid] =>
[yearofmanufacturing_from] =>
[yearofmanufacturing_to] =>
[hoursused_from] =>
[hoursused_to] =>
[horsepowers_from] =>
[horsepowers_to] =>
[price_from] =>
[price_to] =>
[colorid] =>
[isdamaged] =>
)
</pre>
使用下面的代碼:
$this->session->set_userdata($formValues);
不過,我我正在使用分頁,並且在下一頁中,當我嘗試使用以下代碼訪問變量時:
print_r($formValues);
I得到一個空數組。
任何人都可以幫助我嗎?
請提供一個缺少的代碼。 –
我會在一分鐘內更新我的文章... – user2417624
嗨,我只添加了與會話相關的代碼,因爲控制器相當大...你能發現爲什麼這個數組沒有被添加到這個代碼的會話中嗎?如果沒有,我會上傳整個控制器,但它是...大... – user2417624