I just wanted to let the community know what I did to solve this problem.
My goal was to create a confirmation page after a user submitted a form. The problem I was having was that the $HTTP_POST_VARS wouldn’t pass from the confirmation page to the next page after the user confirmed the information was correct. This code shows how to get the original values from the form and use the original variable names.
On the initial form page:
//Set the internal pointer of an array to its first element.
reset ($HTTP_POST_VARS);
$vars = $HTTP_POST_VARS;
$vars = serialize($vars);
$vars = urlencode($vars);
Then create you form
On the confirmation page:
After I display the contents of $HTTP_POST_VARS to the user, I provide them with a confirm button:
<form method=post action="<?=$PHP_SELF?>">
<input type=submit name="confirm" value="ok">
<input type="hidden" name="vars" value="<?=$vars;?>">
</form>
The page after the confirmation page:
$post_vars = urldecode($vars);
$post_vars = unserialize($post_vars);
while (list ($key, $val) = each ($post_vars))
{
//This allows us to use the original form variables for updating the information in a database or whatever you want to do. It’s called a variable variable if you want to look it up.
$$key = $val;
}
If you have any questions or need more specifics let me know. Thanks goes out to Tom for helping me out!