<?php
require_once '../includes/auth.php';
require_once '../../includes/config.php';

$prompt_id = intval($_GET['prompt_id']);

if($_POST){
    $pdo->prepare("
        INSERT INTO mega_prompt_questions (prompt_id,step,question_text)
        VALUES (?,?,?)
    ")->execute([
        $prompt_id,
        $_POST['step'],
        $_POST['question_text']
    ]);
    header("Location: questions.php?id=".$prompt_id);
    exit;
}
?>

<form method="post">
مرحله:<br>
<input name="step" type="number" required><br><br>

متن سوال:<br>
<textarea name="question_text" required></textarea><br><br>

<button>ذخیره</button>
</form>
