ok, i understand your problem...
so, if you see this line
// code in php context
$boxstuff .= "<input type=checkbox name=subcatid$subcatarray[subcatid] value=1> ";
so the result is the name for the checkbox will then replace with subcatidXXXXXXX where the XXXXXXX value come from the $subcatarray['subcatid']. Let say the $subcatarray['subcatid'] is a word 'jimson', so the checkbox actually named subcatidjimson when it get parsed.
so, in order to retrieve the posted data on the subsequent page, you will use $_POST['subcatidjimson'].
I want to know if you are using register_globals = On in your php.ini file.
basically about the function parsevars()
function parsevars() {
global $HTTP_POST_VARS,$subcatidarray;
// so in my example above, my $_POST will contained $_POST['subcatidjimson'] = 1
if (is_array($HTTP_POST_VARS)) {
$idarray=array_keys($HTTP_POST_VARS);
// so $idarray now is
// array (
// [0] = subcatidjimson
// )
$numids = count($idarray);
// $numids = 1
$cnt = 0;
for ($i=0;$i < $numids; $i++) {
if ($idarray[$i] <> "Submit" && substr($idarray[$i],0,8)=="subcatid") {
// so $idarray[0] is not submit and the substr $idarray[0],0,8 is equal to
// subcatid
$subcatidarray[$cnt++] = substr($idarray[$i],8);
// now $subcatidarray <= this variable is global scope
// $subcatidarray[0] = jimson
}
}
}
}
I think I solve the part how the posted input id become available in $subcatidarray.
see the code after this paragraph
Then he prints the selected values on the next page (for approval) with the following:
Ok, you said you want to display the selected item in the next page for approval but, it seems the code are getting data from the database 😕
while ($subcatarray = mysql_fetch_array($result2)) {
he use the $subcatarray to fetch the data from database.
and i really wonder how he can display the posted checkbox in the confirmation page... you provided me with insufficient code to understand your problem.