RE: [PHP-DB] Variable passing

From: Date: Tue, 24 Apr 2001 15:47:36 +0000
Subject: RE: [PHP-DB] Variable passing
Groups: php.db 
Request: Send a blank email to php-db+get-8843@lists.php.net to get a copy of this message
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:aurel@irecson.ro] Sent: Tuesday, April 24, 2001 5:49 AM To: php-db@lists.php.net 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: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#8843) next »