I've written a form that performs form verification on the same page using
if(isset($_POST['submit'])) {
This works just fine. But then, once the form is verified, I need to pass the form data along to another page for processing (i.e., evaluating the data and saving it to a database).
The method I've used for this is to implode the $POST variable on the form page, and attach the resulting string to the location URL for the processing page, like so:
$post_string=implode(',', $_POST);
header("Location: $SECUREPATH/administration/users_process.php?p=" . $post_string . "\n\n");
And then explode the $GET variable string on the form processing page, and reassign the resulting values to their variable names, like so:
$post_array=explode(',', $_GET['p']);
$fname=$post_array[1];
$mname=$post_array[2];
etc.
This doesn't seem like a very efficient way of accomplishing this task of moving data from the form page to the processing page.
Is there a better way? Is there a way, for instance, to force the data already being held in the $_POST array to "repost" to the processing page without the user having to click on a submit button?