diff --git a/admin/api_generate.php b/admin/api_generate.php new file mode 100644 index 0000000..0cfc1ae --- /dev/null +++ b/admin/api_generate.php @@ -0,0 +1,43 @@ + false, 'error' => 'Invalid method']); + exit; +} + +$input = json_decode(file_get_contents('php://input'), true); +$title = $input['title'] ?? ''; + +if (empty(trim($title))) { + echo json_encode(['success' => false, 'error' => 'Please enter a Title first to generate content.']); + exit; +} + +$prompt = "Write a comprehensive, engaging, and well-structured blog post article based on the following title: \"$title\". +Format the text strictly using HTML tags suitable for a WYSIWYG editor (like
,
= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-This page will update automatically as the plan is implemented.
-Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
= htmlspecialchars($projectDescription) ?>
+= htmlspecialchars($post['summary']) ?>
+Head to the Admin panel to write your first article.
+