久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在另一個頁面中獲取 magento 會話變量

Get magento session variable in another page(在另一個頁面中獲取 magento 會話變量)
本文介紹了在另一個頁面中獲取 magento 會話變量的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我在 magento 模態(tài)頁面的會話中設(shè)置了數(shù)組變量,想在另一個頁面(如 getuserdata.php)中檢索但不進入另一個頁面.我設(shè)置變量并進入一頁然后完全檢索.

I set array variable in session in magento modal page and want to retrieve in another page like getuserdata.php but not get in another page. I set variable and get in one page then in completely retrieve.

我的代碼就像..

//第一頁代碼.

$session = Mage::getSingleton("core/session",  array("name"=>"frontend"));
$fldata = 'work for set data';
$session->setData("free_auth", $fldata);

//另一個頁面代碼.

session_start();
require_once ("../../app/Mage.php");
umask(0);
Mage::app('default');
$session = Mage::getSingleton("core/session",  array("name"=>"frontend"));
$stl1 = $session->getData("free_auth");

任何人都可以幫助我解決那個問題..

Anyone can help me for that stuff problem..

推薦答案

如果我們在 Magento 中創(chuàng)建會話,那么我們只能在 Magento 文件中使用該會話,例如在 magento/app 文件夾中.如果您想在您創(chuàng)建的外部文件中使用該會話,那么您必須首先在另一個 Magento 默認文件中獲取該會話,然后調(diào)用 jquery ajax 函數(shù)并通過它傳遞會話變量以將其獲取到外部文件中.您還可以在不使用會話的情況下通過 ajax 傳遞變量.

If we create a session in Magento, then we can only use that session in Magento files like in the magento/app folder. If you want to use that session in external files create by you then you must first get the session in another Magento default file and then call a jquery ajax function and pass session variable through it to get it in an external file. You also pass the variable through ajax without the use of the session.

像這樣設(shè)置會話數(shù)據(jù).

$fldata = 'work for set data';
Mage::getSingleton('core/session')->setMyCustomData($fldata);

并像這樣獲取數(shù)據(jù).

session_start();
$sessionfree = Mage::getSingleton('core/session', array('name' => 'frontend'));
$abcfree = $sessionfree->getMyCustomData();

這篇關(guān)于在另一個頁面中獲取 magento 會話變量的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設(shè)置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數(shù)組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產(chǎn)生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 欧美在线观看一区 | 综合久久亚洲 | 操视频网站| 国产美女福利在线观看 | 成人网av | 特级做a爰片毛片免费看108 | 91视频精选 | 精品一区二区三区在线观看 | 国产91精品久久久久久久网曝门 | 欧美中文字幕在线观看 | 一区二区在线免费播放 | 亚洲乱码国产乱码精品精98午夜 | 综合自拍| 精品国产一区二区三区性色 | 国产一区视频在线 | 亚洲精品在线免费 | 亚洲午夜精品视频 | 自拍视频在线观看 | 国产中文区二幕区2012 | 九九爱这里只有精品 | 精品国产99| 99久久日韩精品免费热麻豆美女 | 国产精品日韩一区二区 | 中文字幕在线观看国产 | 天天爱天天操 | 亚洲高清网 | 99精品国产一区二区三区 | 天堂色区| 91精品国产91久久久久久吃药 | 久久久久久国产精品免费免费男同 | 99精品国产成人一区二区 | 精品欧美一区二区三区久久久 | 在线观看成人小视频 | 国产一级精品毛片 | 国内精品视频免费观看 | av在线电影网 | 天天夜碰日日摸日日澡 | 中文字幕免费视频 | 午夜国产 | 亚洲精品91| 国产美女久久 |