![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/.cursor-server/data/User/History/-43ec0940/ |
<?php
// Test file to verify track link functionality
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Track Link Test</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
.test-link { display: block; margin: 10px 0; padding: 10px; background: #f0f0f0; text-decoration: none; color: #333; }
.test-link:hover { background: #e0e0e0; }
.status { margin: 10px 0; padding: 10px; border-radius: 5px; }
.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
</style>
</head>
<body>
<h1>Track Link Test</h1>
<div class="status info">
<strong>Testing Track Links:</strong> This page tests if track.php links work correctly.
</div>
<h2>Direct Links (Should work normally):</h2>
<a href="/track.php?id=1" class="test-link">Track 1 - Direct Link</a>
<a href="/track.php?id=2" class="test-link">Track 2 - Direct Link</a>
<h2>AJAX Test Links:</h2>
<a href="/track.php?id=1&ajax=1" class="test-link">Track 1 - AJAX Test</a>
<a href="/track.php?id=2&ajax=1" class="test-link">Track 2 - AJAX Test</a>
<h2>AJAX Load Test:</h2>
<button onclick="testAjaxLoad('track', {id: 1})">Test AJAX Load Track 1</button>
<button onclick="testAjaxLoad('track', {id: 2})">Test AJAX Load Track 2</button>
<div id="ajax-result"></div>
<h2>Current Page Info:</h2>
<div class="status info">
<strong>URL:</strong> <?= $_SERVER['REQUEST_URI'] ?><br>
<strong>AJAX Parameter:</strong> <?= isset($_GET['ajax']) ? 'Yes' : 'No' ?><br>
<strong>Track ID:</strong> <?= $_GET['id'] ?? 'None' ?>
</div>
<script>
function testAjaxLoad(pageType, params) {
const ajaxUrl = '/ajax_load_page.php?page=' + pageType + '&' + new URLSearchParams(params).toString();
document.getElementById('ajax-result').innerHTML = '<div class="status info">Loading...</div>';
fetch(ajaxUrl)
.then(response => response.json())
.then(data => {
if (data.success) {
document.getElementById('ajax-result').innerHTML =
'<div class="status success">AJAX Load Success: ' + data.page + '</div>' +
'<div style="max-height: 200px; overflow-y: auto; border: 1px solid #ccc; padding: 10px; margin: 10px 0;">' +
'<strong>Content Preview:</strong><br>' +
data.content.substring(0, 500) + '...' +
'</div>';
} else {
document.getElementById('ajax-result').innerHTML =
'<div class="status error">AJAX Load Failed: ' + (data.error || 'Unknown error') + '</div>';
}
})
.catch(error => {
document.getElementById('ajax-result').innerHTML =
'<div class="status error">AJAX Load Error: ' + error.message + '</div>';
});
}
// Test if track links are being intercepted
document.addEventListener('click', function(e) {
if (e.target.tagName === 'A' && e.target.href.includes('track.php')) {
console.log('Track link clicked:', e.target.href);
// Don't prevent default - let it work normally
}
});
</script>
</body>
</html>