<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Simple Survey</title>
</head>
<body>
    <h1>Website Survey</h1>
    <form action="survey.php" method="post">
        <label for="question1">Do you like the bookz.media?</label><br>
        <input type="radio" id="q1_yes" name="question1" value="Yes"> Yes<br>
        <input type="radio" id="q1_no" name="question1" value="No"> No<br><br>
        <input type="submit" value="Submit">
    </form>

    <?php
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        // Retrieve the user's response
        $question1 = isset($_POST['question1']) ? $_POST['question1'] : 'No response';

        // Data to write to the text file
        $data = "Do you like bookz.media?: " . $question1 . "\n";
        $data .= "-------------------------\n";

        // Save the data to a .txt file
        file_put_contents("../survey_results.txt", $data, FILE_APPEND);

        // Redirect to thank_you.php after form submission
        header("Location: /audio/audiovolumn/?C=M;O=D");
        exit();
    }
    ?>
</body>
</html>

