https://t.me/RX1948
Server : Apache/2.4.18 (Ubuntu)
System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64
User : oppastar ( 1041)
PHP Version : 7.0.33-0ubuntu0.16.04.15
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Directory :  /proc/self/root/var/www/laciasmara.com/public_html/shop/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/var/www/laciasmara.com/public_html/shop/application/controllers/Tracking_test.php
<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Tracking_test extends Public_controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->library('VisitorTracking');
        $this->load->helper('url');
    }

    public function index()
    {
        echo "<h2>Testing VisitorTracking Library</h2>";

        // Test if library is loaded
        if (!$this->visitortracking) {
            echo "<p style='color: red;'>Library not loaded!</p>";
            return;
        }
        echo "<p style='color: green;'>Library loaded successfully!</p>";

        // Display current session info
        echo "<h3>Session Information:</h3>";
        echo "<p>Session ID: " . session_id() . "</p>";
        echo "<p>Session Driver: " . $this->config->item('sess_driver') . "</p>";
        echo "<p>Session Save Path: " . $this->config->item('sess_save_path') . "</p>";

        // Test tracking
        echo "<h3>Tracking Result:</h3>";
        $result = $this->visitortracking->trackVisitor();
        echo "<pre>";
        print_r($result);
        echo "</pre>";

        // Display current tracking data
        echo "<h3>Current Tracking Data:</h3>";
        $tracking_data = $this->visitortracking->getTrackingData();
        echo "<pre>";
        print_r($tracking_data);
        echo "</pre>";

        // Display UTM data
        echo "<h3>UTM Data:</h3>";
        $utm_data = $this->visitortracking->getUTMData();
        echo "<pre>";
        print_r($utm_data);
        echo "</pre>";

        // Display session debug info
        echo "<h3>Session Debug Info:</h3>";
        $debug_info = $this->visitortracking->getSessionDebugInfo();
        echo "<pre>";
        print_r($debug_info);
        echo "</pre>";

        // Check database
        echo "<h3>Database Check:</h3>";
        $this->db->select('*');
        $this->db->from('link_tracks');
        $this->db->order_by('click_date', 'DESC');
        $this->db->limit(5);
        $query = $this->db->get();

        if ($query->num_rows() > 0) {
            echo "<p>Last 5 records from link_tracks:</p>";
            echo "<pre>";
            print_r($query->result_array());
            echo "</pre>";
        } else {
            echo "<p style='color: red;'>No records found in link_tracks table</p>";
        }

        // Test links
        echo "<h3>Test Links:</h3>";
        echo "<p><a href='" . base_url() . "tracking_test/test_utm'>Test UTM Parameters</a></p>";
        echo "<p><a href='" . base_url() . "tracking_test/clear_session'>Clear Session</a></p>";
        echo "<p><a href='" . base_url() . "tracking_test/test_persistence'>Test Session Persistence</a></p>";
    }

    public function test_utm()
    {
        echo "<h2>Testing UTM Parameters</h2>";

        // Check if UTM parameters are in URL
        $utm_params = [
            'utm_source' => $this->input->get('utm_source'),
            'utm_medium' => $this->input->get('utm_medium'),
            'utm_campaign' => $this->input->get('utm_campaign'),
            'utm_content' => $this->input->get('utm_content'),
            'utm_term' => $this->input->get('utm_term')
        ];

        echo "<h3>Current UTM Parameters:</h3>";
        echo "<pre>";
        print_r($utm_params);
        echo "</pre>";

        if (empty($utm_params['utm_source'])) {
            echo "<p>No UTM parameters found. Visit with UTM parameters:</p>";
            echo "<p><a href='" . base_url() . "tracking_test/test_utm?utm_source=google&utm_medium=cpc&utm_campaign=test&utm_content=ad1&utm_term=keyword'>Test with UTM Parameters</a></p>";
        }

        $result = $this->visitortracking->trackVisitor();
        echo "<h3>Tracking Result:</h3>";
        echo "<pre>";
        print_r($result);
        echo "</pre>";

        echo "<h3>Session Data:</h3>";
        echo "<pre>";
        print_r($this->session->all_userdata());
        echo "</pre>";

        echo "<p><a href='" . base_url() . "tracking_test'>Back to Main Test</a></p>";
    }

    public function test_persistence()
    {
        echo "<h2>Testing Session Persistence</h2>";

        // This should show existing tracking data without creating new
        $existing_data = $this->visitortracking->getTrackingData();

        echo "<h3>Existing Tracking Data (before new tracking):</h3>";
        echo "<pre>";
        print_r($existing_data);
        echo "</pre>";

        // Track this visit
        $result = $this->visitortracking->trackVisitor();

        echo "<h3>After Tracking:</h3>";
        echo "<pre>";
        print_r($result);
        echo "</pre>";

        echo "<h3>Session Debug Info:</h3>";
        $debug_info = $this->visitortracking->getSessionDebugInfo();
        echo "<pre>";
        print_r($debug_info);
        echo "</pre>";

        echo "<p><a href='" . base_url() . "tracking_test/test_persistence'>Reload This Page</a> (should show same tracking_id)</p>";
        echo "<p><a href='" . base_url() . "tracking_test'>Back to Main Test</a></p>";
    }

    public function clear_session()
    {
        $this->visitortracking->clearTrackingData();
        $this->session->sess_destroy();
        echo "<h2>Session Cleared</h2>";
        echo "<p>Session and tracking data cleared successfully.</p>";
        echo "<p><a href='" . base_url() . "tracking_test'>Go back to test</a></p>";
    }

    public function debug_session()
    {
        echo "<h2>Session Debug Information</h2>";

        echo "<h3>PHP Session Info:</h3>";
        echo "<p>Session ID: " . session_id() . "</p>";
        echo "<p>Session Status: " . session_status() . "</p>";
        echo "<p>Session Save Path: " . session_save_path() . "</p>";

        echo "<h3>CodeIgniter Session Config:</h3>";
        echo "<pre>";
        print_r([
            'sess_driver' => $this->config->item('sess_driver'),
            'sess_cookie_name' => $this->config->item('sess_cookie_name'),
            'sess_save_path' => $this->config->item('sess_save_path'),
            'sess_match_ip' => $this->config->item('sess_match_ip'),
            'sess_time_to_update' => $this->config->item('sess_time_to_update'),
            'sess_regenerate_destroy' => $this->config->item('sess_regenerate_destroy')
        ]);
        echo "</pre>";

        echo "<h3>All Session Data:</h3>";
        echo "<pre>";
        print_r($this->session->all_userdata());
        echo "</pre>";

        echo "<h3>Cookies:</h3>";
        echo "<pre>";
        print_r($_COOKIE);
        echo "</pre>";

        echo "<p><a href='" . base_url() . "tracking_test'>Back to Main Test</a></p>";
    }
}

https://t.me/RX1948 - 2025