2100) { $error = "Invalid graduation year."; } else { // Check if email already exists $stmt = db()->prepare("SELECT id FROM users WHERE email = ?"); $stmt->execute([$email]); if ($stmt->fetch()) { $error = "Email already registered."; } else { // Generate verification code $verification_code = bin2hex(random_bytes(16)); $hashed_password = password_hash($password, PASSWORD_DEFAULT); // Insert user $stmt = db()->prepare("INSERT INTO users (full_name, email, password, role, university, graduation_year, verification_code) VALUES (?, ?, ?, ?, ?, ?, ?)"); try { $stmt->execute([$full_name, $email, $hashed_password, $role, $university, $graduation_year, $verification_code]); $success = "Registration successful! Please check your email to verify your account."; // Send verification email // MailService::sendMail($email, "Verify your account", "Your verification code is: $verification_code", "Your verification code is: $verification_code"); // For now, we'll just show the success message. } catch (PDOException $e) { $error = "Database error: " . $e->getMessage(); } } } } $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby'; ?> Sign Up — <?= htmlspecialchars($platformName) ?>

Join the Exclusive Network

Verify your student or graduate status to get started.

Go to Log In

Only university/graduate emails accepted.

Already have an account? Log In