Steph's Query Demo via POST

Note this DEMO passes a variable (and it's value) via a POST ternary operation. In other words, the name of the variable and it's value is being passed through POST form.

ID = 0


<?php
include('../header/assignmentHeader.php');

error_reporting(E_ALL);    // set error reporting to all

// get the id from a POST operation via POST ternary operator

$id = isset($_POST['id']) ? $_POST['id'] : 0;

?>
    <link rel="stylesheet" href="../css/assignmentHeaderStyles.css" />

    <h1>Steph's Query Demo via POST</h1>

    <p>
        Note this DEMO passes a variable (and it's value) via a POST ternary operation.
        In other words, the name of the variable and it's value is being passed
        through POST form.
    </p>

    <p>
        ID = <?php echo($id); ?>
    </p>

    <form action="" method="POST">

        <input type="hidden" name="id" value="<?php echo($id - 1); ?>">
        <input type="submit" name="submit" value="DECREASE">

    </form>

    <br>

    <form action="" method="POST">

        <input type="hidden" name="id" value="<?php echo($id + 1); ?>">
        <input type="submit" name="submit" value="INCREASE">

    </form>

<?php
include('../footer/footer.php');
show_source(__FILE__);
?>