34107-vm/chat_logic.php
Flatlogic Bot 4272510c2c chat upd
2025-09-16 17:15:03 +00:00

24 lines
1.7 KiB
PHP

<?php
$message = strtolower($_POST['message'] ?? '');
if (str_contains($message, 'hello') || str_contains($message, 'hi')) {
echo "Hello! I'm Gemini, your in-app assistant. Ask me anything about this application.";
} elseif (str_contains($message, 'vibe')) {
echo "The 'Vibe Generator' (`vibe.php`) lets you generate random color palettes and CSS gradients. You can even save and share your favorite themes.";
} elseif (str_contains($message, 'seo')) {
echo "The 'SEO Checker' (`seo.php`) analyzes the on-page SEO of a given URL. It checks for title tags, meta descriptions, headings, and more.";
} elseif (str_contains($message, 'sandbox')) {
echo "The 'PHP Sandbox' (`sandbox.php`) is a safe environment where you can execute arbitrary PHP code and see the output.";
} elseif (str_contains($message, 'contact')) {
echo "The 'Contact' page (`contact.php`) contains a form that allows you to send an email using the app's built-in mail service.";
} elseif (str_contains($message, 'admin')) {
echo "The 'Admin' page (`admin.php`) is for managing the 'Nokia Facts'. It's a full CRUD interface for creating, reading, updating, and deleting facts.";
} elseif (str_contains($message, 'chat')) {
echo "This is the 'Chat' page (`chat.php`). You're talking to me right now! I can tell you about the different features of this application.";
} elseif (str_contains($message, 'home') || str_contains($message, 'index')) {
echo "The 'Home' page (`index.php`) is the main landing page of the application.";
} else {
echo "I'm sorry, I don't have information about that. I can answer questions about the Vibe Generator, SEO Checker, PHP Sandbox, Contact Form, Admin page, and the Chat feature.";
}