2017-11-18 1 views
0

opencart를 처음 사용했습니다. 내 기본 PHP 코드는 http://localhost/testphpphp 파일을 통한 opencart의 세션 데이터 액세스

이고 내 opencart는 http://localhost/opencart에 있습니다. 제가하고 싶은 것은 testphp에 제가 want to check that if any user is logged in or not at opencart 인 페이지가 있습니다. 그 다음에 로그온 한 경우

나는 X 기능

을 수행 할 그리고 그것은 내가 opencart하려면 로그인을 시도하고 testphp에 print_r($_SESSION)에 시도

Y 기능을 수행 할 다음 접속되지 않았습니다. 빈칸으로 돌아갑니다. 이것을 어떻게 할 수 있습니까? 제발 도와주세요

+0

OpenCart 데이터베이스에서'customer_online' 테이블이 될 것입니다. 'admin \ model \ report \ customer.php'의'getCustomersOnline' 함수를보십시오. – DigitCart

답변

1

당신이 이것을 시도해 볼 수 있습니다. 또는 같은 호스팅 계정이나의 cPanel

이동이 이 코드

class ControllerCommonHeader extends Controller { 
    public function index() {  
      session_start(); 
      $_SESSION['opencart'] = $this->session->data; 
추가 "() {공공 기능 지수" 전/컨트롤러/일반/header.php

를 카탈로그 화

배열을 인쇄하려면 http://localhost/testphp 코드 :

,210

귀하의 출력

Array 
(
    [opencart] => Array 
     (
      [language] => en-gb 
      [currency] => USD 
      [customer_id] => 2 
      [shipping_address] => Array 
       (
        [address_id] => 2 
        [firstname] => Prashant 
        [lastname] => Bhagat 
        [company] => 
        [address_1] => Surat 
        [address_2] => 
        [postcode] => 395003 
        [city] => Surat 
        [zone_id] => 1485 
        [zone] => Gujarat 
        [zone_code] => GU 
        [country_id] => 99 
        [country] => India 
        [iso_code_2] => IN 
        [iso_code_3] => IND 
        [address_format] => 
        [custom_field] => 
       ) 

     ) 

) 
관련 문제