T.ME/BIBIL_0DAY
CasperSecurity


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/-101f97f1/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/.cursor-server/data/User/History/-101f97f1/T2k3.php
<?php
session_start();

// Check if user is logged in
if (!isset($_SESSION['user_id'])) {
    echo "<h2>โŒ Not Logged In</h2>";
    echo "<p>Please <a href='/auth/login_new.php'>login</a> to test profile editing.</p>";
    exit;
}

echo "<h2>๐Ÿงช Profile Edit Test</h2>";
echo "<p>Testing profile editing for user ID: " . $_SESSION['user_id'] . "</p>";

// Test 1: Check if API endpoints exist
echo "<h3>1. API Endpoint Check</h3>";
$update_api = file_exists('api/update_profile.php');
$upload_api = file_exists('api/upload_profile_image.php');

echo "โœ… Update Profile API: " . ($update_api ? 'EXISTS' : 'MISSING') . "<br>";
echo "โœ… Upload Image API: " . ($upload_api ? 'EXISTS' : 'MISSING') . "<br>";

// Test 2: Check uploads directory
echo "<h3>2. Upload Directory Check</h3>";
$upload_dir = 'uploads/profile_images/';
$dir_exists = is_dir($upload_dir);
$dir_writable = is_writable($upload_dir);

echo "โœ… Upload Directory: " . ($dir_exists ? 'EXISTS' : 'MISSING') . "<br>";
echo "โœ… Directory Writable: " . ($dir_writable ? 'YES' : 'NO') . "<br>";

// Test 3: Check database connection
echo "<h3>3. Database Connection Test</h3>";
try {
    require_once 'config/database.php';
    $pdo = getDBConnection();
    if ($pdo) {
        echo "โœ… Database connection: SUCCESS<br>";
        
        // Check if user exists
        $stmt = $pdo->prepare("SELECT name, profile_image FROM users WHERE id = ?");
        $stmt->execute([$_SESSION['user_id']]);
        $user = $stmt->fetch();
        
        if ($user) {
            echo "โœ… User found: " . htmlspecialchars($user['name']) . "<br>";
            echo "โœ… Profile image: " . ($user['profile_image'] ? 'SET' : 'NOT SET') . "<br>";
        } else {
            echo "โŒ User not found in database<br>";
        }
    } else {
        echo "โŒ Database connection: FAILED<br>";
    }
} catch (Exception $e) {
    echo "โŒ Database error: " . $e->getMessage() . "<br>";
}

// Test 4: Check user_profiles table
echo "<h3>4. User Profiles Table Check</h3>";
try {
    $stmt = $pdo->prepare("SELECT COUNT(*) as count FROM user_profiles WHERE user_id = ?");
    $stmt->execute([$_SESSION['user_id']]);
    $profile_count = $stmt->fetch()['count'];
    
    echo "โœ… User profile record: " . ($profile_count > 0 ? 'EXISTS' : 'MISSING') . "<br>";
} catch (Exception $e) {
    echo "โŒ User profiles table error: " . $e->getMessage() . "<br>";
}

echo "<h3>5. Test Links</h3>";
echo "<a href='/artist_profile.php?id=" . $_SESSION['user_id'] . "' target='_blank'>๐Ÿ”— Go to Your Profile</a><br>";
echo "<a href='/api/update_profile.php' target='_blank'>๐Ÿ”— Test Update API</a><br>";
echo "<a href='/api/upload_profile_image.php' target='_blank'>๐Ÿ”— Test Upload API</a><br>";

echo "<h3>6. Manual API Test</h3>";
echo "<p>Test the update API with this curl command:</p>";
echo "<code>curl -X POST /api/update_profile.php -H 'Content-Type: application/json' -d '{\"name\":\"Test User\",\"location\":\"Test City\",\"bio\":\"Test bio\"}'</code>";

echo "<br><br><a href='/index.php'>๐Ÿ  Return to Homepage</a>";
?> 

CasperSecurity Mini