<html>
<head>
<title>Process an HTML form</title>
</head>
<body bgcolor=lightyellow>
<h1><center>The Ice Cream Shop</center></h1>
<h2>Process data from another page. Generic Retrieve</h2>

<table border=2>
<tr bgcolor=tan>
<th>Element Name</th><th>Element Value</th> 

<?php

//----- Generic retrieve of form data -------------------------------------

        if ($_SERVER['REQUEST_METHOD'] == 'GET')        //if method used is GET
            $data = $_GET;                              //retrieve from $_GET array
        else                                            //otherwise
            $data = $_POST;                             //retrieve from $_POST array

        foreach($data as  $entryName => $entryValue)
        {
            if (is_array($entryValue))
                $entryValue = implode(',' , $entryValue);

            print "<tr><th>$entryName</th><td>$entryValue</td> \n";
        }

?>
</table>

<?php include "../include.php"; ?>              <!-- hyperlink to see the code -->
</body>
</html>