Passing variables in a multiple part form

From: Date: Wed, 03 Jan 2001 00:29:36 +0000
Subject: Passing variables in a multiple part form
Groups: php.general 
Request: Send a blank email to php-general+get-32427@lists.php.net to get a copy of this message
I am using PHP3.016 I would like help in setting up the ability to pass a variable from one form into the second part of the same form and then again to a third and perhaps 4th part of the same form. Basically I have a rough setup on mysite at http://mackey-decorating.com/CSForm_start.php3 The first part works fine as does the second part. However after that the variables that are created during the loop which makes the table and inserts the textareas for data collection are lost when the function ends. The third part of this form works only because I wrote the code for each individual table cell. Very time consuming and inefficient. (Sample) $y=1; Print " <table border=\"2\" cellpadding=\"3\" cellspacing=\"1\">\n"; Print " <tr>\n"; Print " <td width=\"100\">\n"; if ($y<$roomcount) { print " $Room1\n"; Print " </td>\n"; Print "<td width=\"100\">\n"; print "<input type=\"text\" name=\"Room$y\" size=\"20\">\n"; Print "</td>\n"; Print " <td width=\"100\">\n"; print "<input type=\"text\" name=\"Room$y\" size=\"20\">\n"; Print "</td>\n"; Print "<td width=\"100\">\n"; Print "<input type=\"text\" name=\"Room$y\" size=\"20\">\n"; Print " </td>\n"; Print " <td width=\"100\">\n"; print "<input type=\"text\" name=\"Room$y\" size=\"20\">\n"; Print " </td>\n"; Print "</tr>\n"; Print " <tr>\n"; Print " <td width=\"100\">\n"; } $y=$y+1; if ($y<$roomcount) { print" $Room2\n"; Print " </td>\n"; Print "<td width=\"100\">\n"; print "<input type=\"text\" name=\"Room$y\" size=\"20\">\n"; Print "</td>\n"; Print " <td width=\"100\">\n"; print "<input type=\"text\" name=\"Room$y\" size=\"20\">\n"; Print "</td>\n"; Print "<td width=\"100\">\n"; Print "<input type=\"text\" name=\"Room$y\" size=\"20\">\n"; Print " </td>\n"; Print " <td width=\"100\">\n"; print "<input type=\"text\" name=\"Room$y\" size=\"20\">\n"; Print " </td>\n"; Print "</tr>\n"; Print " <tr>\n"; Print " <td width=\"100\">\n"; } (End sample) All help will be appreciated.

« previous php.general (#32427) next »