prepare("SELECT id FROM users WHERE email = ? LIMIT 1"); $stmt->execute([$email]); if ($stmt->fetch()) { $errors[] = 'An account with that email already exists.'; } else { $hash = password_hash($password, PASSWORD_DEFAULT); $stmt = $pdo->prepare("INSERT INTO users (name, email, password_hash, created_at) VALUES (?, ?, ?, NOW())"); $stmt->execute([$name, $email, $hash]); $userId = $pdo->lastInsertId(); // Auto-login: store minimal user data in session $_SESSION['user_id'] = $userId; $_SESSION['user_name'] = $name; $_SESSION['user_email'] = $email; // rotate CSRF token $_SESSION['csrf_token'] = bin2hex(random_bytes(24)); $success = true; header('Location: dashboard.php'); exit; } } catch (Exception $e) { error_log('register error: ' . $e->getMessage()); $errors[] = 'Server error. Please try again later.'; } } } ?> Register - AirdropPilot Skip to content
AirdropPilot

Create Account

Start your 14-day free trial

Password must be at least 8 characters.

or continue with

Already have an account? Log in