Please send questions to st10@humboldt.edu .
<html>

<!-- try_hidden.php

     ... adding a hidden parameter to a form
     
     adapted from "Learning PHP 5", Sklar, O'Reilly, Chapter 9
     adapted by: Sharon Tuttle
     last modified: 11-16-06
-->

<head>
    <title> playing with here documents and hidden parameters</title>
</head>

<body>
    <h2> playing with here documents and hidden parameters </h2>    

    <h3>
    <?php
        // make use of the hidden parameter here, instead
        //if (array_key_exists('customer_name',$_POST)) 

        if ($_POST["_submit_check"])
        {
            $name = $_POST["customer_name"];
            print <<<HTMLSTUFF
            $name's items
                <ul> 
                    <li> $name's books
                    <li> $name's magazines
                    <li> $name's bicycles
                </ul>
HTMLSTUFF;
        } 
        else 
        {
            print <<<HTMLFORM
            <form method="post" action="$_SERVER[PHP_SELF]">
                    Your name: <input type="text" name="customer_name">
                    <br>
                    <input type="submit" value="Say Hello">
                    <input type="reset">
                    <input type="hidden" name="_submit_check" value="1">
                </form>
HTMLFORM;
        }
    ?>

    </h3>

</body>
</html>