Got a problem. I've created an online enrollment application, that collects data from multiple forms before writing to a .txt file. On each form, I'm using the following script to dynamically create hidden input fields as the user travels through the application:
<?php
// ---------------------
// Do while there is an element in $HTTP_POST_VARS...
while (list($name, $value) = each($HTTP_POST_VARS))
/ ...get the name and value of the element and use it to construct a hidden input field.
Then go back to the beginning of the loop and do the same thing with the next element. /
{
echo "<input type=\"hidden\" value=\"$value\" name=\"$name\">\n";
}
?>
The problem comes when the data needs to be deposited into a txt file. When I list all possible data types, and try to $_POST[firstName], the variables that were filled out are fine but all others error out. There are over 300 different variables being collected, some required others not.
Is there anyway to dynamically look at what variables are available in the $HTTP_POST_VARS trick i used above, and only list those?
Or should I use some sort of If...else trick to see if that variable is present, and if so echo the value?
Any help would be greatly appreciated. Thx