One of the most difficult part of coding in any scripting language is picking apart the value of the variables that are passed through forms, either explicitly or inherently. Placing the following segment of code on the CALLED page (the page that processes the form's information) will list all of the variables that have been passed in your form from the CALLING page (the page that has the form on it)
<? /* ****************************************** This small section will display form fields for debugging *********************************************** */ echo "Values submitted via POST method:<br />\n"; reset ($_POST); while (list ($key, $val) = each ($_POST)) { echo "$key => $val<br />\n"; } ?>
Place this in the page body of your called page before any processing is done. The code is a simple while loop that traverses the PHP environment array $_POST and displays the values. It will help you determine what is and is not being sent to your page.
This tutorial written and maintained by Tami, Honey House Web Designs, LLC
|