动态列表框 - 据我所知,存在很多差距

what im trying to achieve is build a set of 3 list boxes. the idea is to allow the user to drill down from vague (primary) to the detailed (tertiary). to do this my intention is to have the secondary list include what was selected in the primary and so on.

so at the top level i have this;

<html>
    <body>
        <h1>Please use this page to enter the project details of the work completed</h1>

            <Form action ="get_primary.php" method = "post">
                Primary: <input type = "text" name ="ws_desc_primary" value = "$primary" /> <br><br>
                <input type="submit" value="click" name="submit" />
            </Form>

            <Form action ="get_secondary.php" method = "post">
                Secondary: <input type = "text" name ="ws_desc_secondary" value = "$secondary" /> <br><br>
                <input type="submit" value="click" name="submit" />
            </Form>

            <Form action ="get_tertiary.php" method = "post">
                Tertiary: <input type = "text" name ="ws_desc_tertiary" value = "$tertiary" /> <br><br>
                <input type="submit" value="click" name="submit" />
            </Form>
    </body>
</html>

what i would like is for example name ="ws_desc_primary" to display the results of get_primary.php. once the user has selected from that list "$secondary" is then populated with the results of get_secondary.php.

you can see these php files below. there is a get_tertiary but im hoping with enough guidance i can add that one myself.

im pretty sure there is a requirement for javascript here for the dynamic stuff but im really struggling.

any help is greatly appreciated.

thanks

get_primary.php

    <?php
    $servername = "localhost";
    $username = "root";
    $password = "";
    $dbname = "worksheets";

    $customer = "Manchester";

    // Create connection
    $conn = mysqli_connect($servername, $username, $password, $dbname);
    // Check connection
    if (!$conn) {
        die("Connection failed: " . mysqli_connect_error());
    }

    $sql = 'call worksheets.get_primary("'.$customer.'" )';
    $descriptions = array();

    if ($result = mysqli_query($conn, $sql)) {

        foreach($result as $value){
            $descriptions = $value;
        }

    } else {
        echo "Error getting description: " . mysqli_error($conn);
    }


    mysqli_close($conn);
    ?>

get_secondary.php

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "worksheets";

$customer = "Manchester";
$primary = $_POST['ws_desc_primary'];

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

$sql = 'call worksheets.get_secondary("'.$customer.'" ,"'.$primary.'")';
$descriptions = array();


if ($result = mysqli_query($conn, $sql)) {

    foreach($result as $value){
        $descriptions = $value;
    }

} else {
    echo "Error getting description: " . mysqli_error($conn);
}

mysqli_close($conn);
?>