false,'error'=>'Method not allowed']); exit; } $data = json_decode(file_get_contents('php://input'), true); $username = trim($data['username'] ?? ''); $password = trim($data['password'] ?? ''); $alias = trim($data['alias'] ?? ''); $email = trim($data['email'] ?? ''); $referralCode= trim($data['referral_code']?? ''); logSecurityEvent('REGISTER_ATTEMPT', null, 'Registration attempt for: ' . $email, 'info'); $result = initiateRegistration($username, $password, $alias, $email, $referralCode); echo json_encode($result);