Austin's Query Demo via GET

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

Please note the string "?id=-9" in the URL.

ID = -9

DECREASE ID     INCREASE ID      

Code follows

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Query Get</title>
    <link rel="stylesheet" href="../css/styles.css">
</head>
<body>

<div class="page">

    <p class="nav"><a href="../../index.php">Home</a></p>

    <?php

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

    // get the id from the URL via GET ternary operator

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

    
?>

    <h1>Austin's Query Demo via GET</h1>

    <p>
        Note this DEMO passes a variable (and it's value) via a GET ternary operation.
        In other words, the name of the variable and it's value is being passed
        through the URL. There is no form involved.
    </p>
    <p>
        Please note the string "?id=<?php echo($id); ?>" in the URL.
    </p>

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

    <a href="query-get.php?id=<?php echo($id - 1); ?>"> DECREASE ID </a> &nbsp; &nbsp;
    <a href="query-get.php?id=<?php echo($id + 1); ?>"> INCREASE ID </a> &nbsp;  &nbsp; &nbsp;

    <hr>

    <hr>

    <h2>Code follows</h2>

    <div class="code"><?php highlight_file(__FILE__); ?></div>

    <p class="nav nav-foot"><a href="../../index.php">Home</a></p>

</div>

</body>
</html>