-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug.php
More file actions
60 lines (50 loc) · 2.45 KB
/
debug.php
File metadata and controls
60 lines (50 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
// Include the universal config
require_once 'includes/config.php';
// Debug page to help identify XAMPP and web hosting path issues
echo "<h2>Universal Path Debug Information</h2>";
echo "<h3>Server Information:</h3>";
echo "<p><strong>HTTP_HOST:</strong> " . $_SERVER['HTTP_HOST'] . "</p>";
echo "<p><strong>REQUEST_URI:</strong> " . $_SERVER['REQUEST_URI'] . "</p>";
echo "<p><strong>SCRIPT_NAME:</strong> " . $_SERVER['SCRIPT_NAME'] . "</p>";
echo "<p><strong>DOCUMENT_ROOT:</strong> " . $_SERVER['DOCUMENT_ROOT'] . "</p>";
echo "<p><strong>Current Directory:</strong> " . __DIR__ . "</p>";
echo "<h3>File Existence Check:</h3>";
$files_to_check = [
'assets/images/RL-logo.png',
'assets/images/code.png',
'assets/css/coreloop.css',
'includes/navigation.php',
'includes/header.php'
];
foreach ($files_to_check as $file) {
$exists = file_exists($file) ? '✅ EXISTS' : '❌ MISSING';
echo "<p><strong>$file:</strong> $exists</p>";
}
echo "<h3>Generated URLs (what navigation.php would create):</h3>";
$request_uri = $_SERVER['REQUEST_URI'];
$is_in_projects = (strpos($request_uri, '/projects/') !== false);
if ($is_in_projects) {
$base_path = '../';
echo "<p>Detected: IN PROJECTS SUBDIRECTORY</p>";
} else {
$base_path = '';
echo "<p>Detected: IN ROOT DIRECTORY</p>";
}
echo "<p><strong>Base path:</strong> '$base_path'</p>";
echo "<p><strong>Logo URL would be:</strong> {$base_path}assets/images/RL-logo.png</p>";
echo "<p><strong>Code.png URL would be:</strong> {$base_path}assets/images/code.png</p>";
echo "<p><strong>Home link would be:</strong> {$base_path}index.php</p>";
echo "<h3>Universal Configuration Test:</h3>";
echo "<p><strong>WDS_BASE_URL:</strong> " . WDS_BASE_URL . "</p>";
echo "<p><strong>getBasePath():</strong> '" . getBasePath() . "'</p>";
echo "<p><strong>Logo URL (absolute):</strong> " . getAssetUrl('assets/images/RL-logo.png') . "</p>";
echo "<p><strong>Home URL (relative):</strong> " . getPageUrl('index.php') . "</p>";
echo "<h3>Web Host Compatibility:</h3>";
echo "<p>✅ <strong>Relative paths:</strong> Will work on any hosting platform</p>";
echo "<p>✅ <strong>Auto-detection:</strong> Adapts to subdirectory installations</p>";
echo "<p>✅ <strong>HTTPS support:</strong> Detects protocol automatically</p>";
echo "<h3>Test Links:</h3>";
echo "<p><a href='" . getPageUrl('index.php') . "'>Home Page Test</a></p>";
echo "<p><a href='" . getPageUrl('projects.php') . "'>Projects Page Test</a></p>";
?>