This question builds off of this question I had earlier... I have a php form that submits fine. I am adding an "ADD MORE" feature to it that adds this entire fieldset again.
//access changes
if ($reqtype=="accesschange"){
$subject="FORM: Request Access Change(s) To Exisiting Folder";
$note .="Full Path of folder to change access: $fullpath \n\n";
if($userpermissiongroup != ""){
$note .="User Permission Group to be changed: $userpermissiongroup \n";
}
if($addreadaccess != ""){
$note .="Additional users requiring read access: $addreadaccess \n";
}
if($addauthoraccess != ""){
$note .="Additional users requiring author access: $addauthoraccess \n";
}
if($removeaccess != ""){
$note .="Users to be removed from access: $removeaccess \n";
}
$note .="Data Steward, Program Manager, Project Lead, or Supervisor who can authorize access changes: $supervisor \n\n";
$note .="Phone number of approving official: $phoneapprover \n";
}
If the user clicks more, then this foreach runs through the added fields:
$addQues = array(
"Full Path of folder to change access:",
"User Permission Group to be changed:",
"Additional users requiring read access:",
"Additional users requiring author access:",
"Users to be removed from access:",
"Data Steward, Program Manager, Project Lead, or Supervisor who can authorize access changes:",
"Phone number of approving official:",
);
foreach($_REQUEST['addfield'] as $k => $value) {
$note .= "$addQues[$k] $value";
}
It will take the 1st fields, that is the php added one... then the 1st fieldset that is added via javascript (user added), but it will not take the 2nd or 3rd... so my data ends up looking like:
Full Path of folder to change access: t:\this-drive User Permission Group to be changed: dv group Additional users requiring read access: jfla Additional users requiring author access: azann Users to be removed from access: dlint Data Steward, Program Manager, Project Lead, or Supervisor who can authorize access changes: gpone Phone number of approving official: 888-888-7777
Full Path of folder to change access: o:\driveUser Permission Group to be changed: odrive groupAdditional users requiring read access: sjonesAdditional users requiring author access: pvalleUsers to be removed from access: kpowerData Steward, Program Manager, Project Lead, or Supervisor who can authorize access changes: bzellPhone number of approving official: 777-777-7777
i:\new i group urusa mmalone jjon yokis 888-999-555
u:\ u group phammer midnite bmarley gdead 777-444-2222
Why is that foreach not picking up the addQues() a second time?
VAR_DUMP $_REQUEST
array(22) { ["name"]=> string(1) " " ["email"]=> string(14) "" ["add"]=> string(0) "" ["citystate"]=> string(4) ", " ["phone1"]=> string(0) "" ["phone2"]=> string(0) "" ["reqtype"]=> string(12) "accesschange" ["newpath"]=> string(0) "" ["usersaccess"]=> string(0) "" ["ryesaccess"]=> string(0) "" ["approvingofficer"]=> string(0) "" ["sphone"]=> string(0) "" ["comments"]=> string(0) "" ["fullpath"]=> string(14) "t:\this-drive" ["userpermissiongroup"]=> string(8) "dv" ["addreadaccess"]=> string(9) "jflat" ["addauthoraccess"]=> string(5) "bzat" ["removeaccess"]=> string(5) "dlit" ["supervisor"]=> string(6) "lnat" ["phoneapprover"]=> string(12) "888-888-7777" ["addfield"]=> array(21) { [0]=> string(9) "o:\drive" 1=> string(12) "odrive group" [2]=> string(6) "sjones" [3]=> string(6) "pvae" [4]=> string(7) "kpow" [5]=> string(8) "bdez" [6]=> string(12) "777-777-7777" [7]=> string(7) "i:\new" [8]=> string(7) "i group" [9]=> string(5) "urusa" [10]=> string(7) "mmalone" [11]=> string(4) "jjon" [12]=> string(5) "yokis" [13]=> string(11) "888-999-555" [14]=> string(4) "u:\" [15]=> string(7) "u group" [16]=> string(7) "phammer" [17]=> string(7) "midnite" [18]=> string(7) "bmarley" [19]=> string(5) "gdead" [20]=> string(12) "777-444-2222" } ["c_id"]=> string(0) "" }
the var_dump for the info I am getting would be: var_dumb($_REQUEST['addfield']
array(21) { [0]=> string(9) "o:\drive" 1=> string(12) "drive group" [2]=> string(6) "sjones" [3]=> string(6) "pval" [4]=> string(7) "kpow" [5]=> string(8) "bdezl" [6]=> string(12) "777-777-7777" [7]=> string(7) "i:\new" [8]=> string(7) "i group" [9]=> string(5) "urusa" [10]=> string(7) "mmalone" [11]=> string(4) "jjon" [12]=> string(5) "yokis" [13]=> string(11) "888-999-555" [14]=> string(4) "u:\" [15]=> string(7) "u group" [16]=> string(7) "phammer" [17]=> string(7) "midnite" [18]=> string(7) "bmarley" [19]=> string(5) "gdead" [20]=> string(12) "777-444-2222" }
var_dump($_REQUEST);?