prepare("SELECT is_writer FROM users WHERE id = :user_id"); $stmt->execute(['user_id' => $user_id]); $is_writer = $stmt->fetchColumn(); $stmt = db()->prepare("SELECT status FROM writer_applications WHERE user_id = :user_id"); $stmt->execute(['user_id' => $user_id]); $application = $stmt->fetch(); if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['apply'])) { if (!$is_writer && (!$application || $application['status'] == 'rejected')) { $bio = trim($_POST['bio']); if (!empty($bio)) { try { $stmt = db()->prepare("INSERT INTO writer_applications (user_id, bio, status) VALUES (:user_id, :bio, 'pending') ON DUPLICATE KEY UPDATE bio = :bio, status = 'pending'"); $stmt->execute(['user_id' => $user_id, 'bio' => $bio]); $message = '
Your application has been submitted for review.
'; // Refresh application status $stmt = db()->prepare("SELECT status FROM writer_applications WHERE user_id = :user_id"); $stmt->execute(['user_id' => $user_id]); $application = $stmt->fetch(); } catch (PDOException $e) { $message = '
Error: ' . $e->getMessage() . '
'; } } else { $message = '
Please provide a short bio or reason for your application.
'; } } } ?>

Become a Writer

You are already a writer.
You have a pending application. Please wait for an admin to review it.
Your application was approved! You are now a writer.
Your previous application was rejected. You may reapply with more information.
Writer Application

Tell us a bit about yourself and why you'd like to be a writer on our platform.