Ice Cream Sundae Maker:

Gasoline
Hot Dog Water
Broken Glass
An Old Shirt
Egg Shells
Green, Moldy Mozzarella
Duck Foot

Code:

<html>
<head>
<title>PHP TEST YAHHH</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>

<div class="topbar">
<?php
include 'navbar.php';
?>
</div>

<?php
    
    //small form playground
    
    define("THIS_PAGE", basename($_SERVER['PHP_SELF']));
    
    if (isset($_POST['submit']))
    {//show post data
        
        echo '<br>';
        echo 'You ordered a sundae with ';
        
        
        //for testing
        $toppings = $_POST['toppings'];
        $arrLength = count($toppings);
        
        if (empty($toppings))
        {
            echo 'no toppings! Pretty boring.';
        }
        else if ($arrLength == 1)
        {
            echo $toppings[0];
            echo '.';
        }
        else if ($arrLength == 2)
        {
            echo $toppings[0];
            echo ' and ';
            echo $toppings[1];
            echo '.';
        }
        else if ($arrLength >= 3)
        {
            for ($i = 0; $i < $arrLength - 2; $i++)
            {
                echo $toppings[$i];
                echo ', ';
            }
            echo $toppings[$i];
            $i++;
            echo ' and ';
            echo $toppings[$i];
            echo '.';
        }
        
        echo '<br><br><br><br>';
        echo 'How about another?';
        echo '<br><br><br>';
        
    }
    
    else
    {
        echo 'Ice Cream Sundae Maker: <br>';
    }
    
    echo '
        <form action="'.THIS_PAGE.'" method="post">
        <label for="toppings">Pick a few toppings: </label><br>
            <input type="checkbox" name="toppings[]" value="gasoline">Gasoline<br>
            <input type="checkbox" name="toppings[]" value="hot dog water">Hot Dog Water<br>
            <input type="checkbox" name="toppings[]" value="broken glass">Broken Glass<br>
            <input type="checkbox" name="toppings[]" value="an old shirt">An Old Shirt<br>
            <input type="checkbox" name="toppings[]" value="eggshells">Egg Shells<br>
            <input type="checkbox" name="toppings[]" value="green, moldy mozzarella">Green, Moldy Mozzarella<br>
            <input type="checkbox" name="toppings[]" value="duck foot">Duck Foot<br>
        <input type = "submit" name = "submit">
        </form>
    ';
    
    echo '<br>';
    
?>

<div class="codebox">
<h3>Code:</h3>
<?php
highlight_file(THIS_PAGE);
?>
</div>

</body>
</html>