File manager - Edit - /home/justdoit/portal.springpasscapital.com/test-register.php
Back
<?php require_once 'config/database.php'; echo "<h2>Registration Diagnostic</h2>"; // Test database connection echo "<p><strong>Database:</strong> Connected ✅</p>"; // Check users table columns echo "<h3>Users Table Columns:</h3>"; $columns = $pdo->query("SHOW COLUMNS FROM users")->fetchAll(); echo "<ul>"; foreach ($columns as $col) { echo "<li>{$col['Field']} - {$col['Type']} - Null: {$col['Null']}</li>"; } echo "</ul>"; // Check if preferred_currency exists $hasCurrency = false; foreach ($columns as $col) { if ($col['Field'] === 'preferred_currency') { $hasCurrency = true; break; } } if (!$hasCurrency) { echo "<p style='color:orange;'>⚠️ preferred_currency column missing. Adding now...</p>"; try { $pdo->exec("ALTER TABLE users ADD COLUMN preferred_currency VARCHAR(3) DEFAULT 'USD'"); echo "<p style='color:green;'>✅ preferred_currency column added!</p>"; } catch (PDOException $e) { echo "<p style='color:red;'>❌ Failed: " . $e->getMessage() . "</p>"; } } // Check other required tables $tables = ['accounts', 'transactions', 'rewards', 'messages', 'security_logs']; echo "<h3>Required Tables:</h3>"; foreach ($tables as $table) { $exists = $pdo->query("SHOW TABLES LIKE '$table'")->rowCount() > 0; echo "<p>" . ($exists ? '✅' : '❌') . " $table</p>"; } // Test insert echo "<h3>Test User Insert:</h3>"; try { $pdo->beginTransaction(); $testData = [ 'Test User', 'testuser99', 'test99@test.com', password_hash('Test@1234', PASSWORD_DEFAULT), '+1234567890', '2000-01-01', 'TU', 'pet', password_hash('fluffy', PASSWORD_DEFAULT), 'TEST1234', 0, 'USD' ]; $stmt = $pdo->prepare(" INSERT INTO users ( full_name, username, email, password, phone, date_of_birth, avatar, security_question, security_answer, referral_code, role, status, marketing_consent, preferred_currency, created_at, updated_at ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'customer', 'pending_kyc', ?, ?, NOW(), NOW() ) "); $stmt->execute($testData); $testId = $pdo->lastInsertId(); echo "<p style='color:green;'>✅ Test insert successful! ID: $testId</p>"; $pdo->rollBack(); echo "<p>Test data rolled back.</p>"; } catch (PDOException $e) { $pdo->rollBack(); echo "<p style='color:red;'>❌ Test insert failed: " . $e->getMessage() . "</p>"; } echo "<hr>"; echo "<p><a href='register.php'>Go to Registration Page</a></p>"; ?>
| ver. 1.4 |
Github
|
.
| PHP 7.0.33 | Generation time: 2.2 |
proxy
|
phpinfo
|
Settings