The HTTP_POST_VARS variable is an array of all the variables posted from the
previous page. I did the same thing a lot and finally ended up creating this
function:

// Function to Pass Posted Variables as Hidden
function PassHiddenVars ()
{
        // Bring in Posted Vars
        global $HTTP_POST_VARS;
        
        foreach($HTTP_POST_VARS as $InputName => $InputValue)
        {
                $HiddenInputs .= "<INPUT NAME='$InputName' TYPE='hidden'
VALUE='$InputValue'>\n";
        }; 
        
        return $HiddenInputs;
}

To use it, just put this function somewhere in your code in a header or
footer, and then right before your </FORM> tag, put in:

<? print PassHiddenVars(); ?>

or if you don't have short-open tags on:

<?php print PassHiddenVars(); ?>

This will recreate all the previously-POSTed fields as hidden inputs that
will get posted to the next page as well. Just put that line (print
PassHidden...) before each of your </FORM> tags, and it should work fine.

-- Jonathan Hilgeman



-----Original Message-----
From: Brinzoi Constantin Aurelian [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 5:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Variable passing


Hi !

Here is the problem: I got 8 pages, shown one after another. Each have 2
buttons (one for continue and one for abort). When I click to "Continue" I
go to the next page. On the last page I have to submit ALL variables from
these 8 pages to the database.

My test shown that only the variables from the last page are filled-in and
otherones are empty.

I have tried with another php page that includes all 8 - 
include("page..."). Worthless!

What can I do?

TIA,

Constantin Brinzoi
Dept. Sondaje
IRECSON


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to