I thought I had done this right, but obviously I didnt and not sure where to go from here.
This is the code I had:
<TR><TD width="250"><$font_color>Member:</FONT></TD><TD align="right"> <INPUT TYPE="TEXT" NAME="Member" SIZE="11" VALUE="$per_mem" MAXLENGTH="11"></TD></TR> |;
}
else { print qq| <input type="hidden" NAME="Member" VALUE="$per_mem">|; }
which what I was trying to do is say if logged in as admin (or have admin permission), view the Member field and pass the value of per_mem into that field, if not admin, make the Member field hidden, but still pass the value of per_mem. Then I am trying to sort by the Member field for 1's to be first and 0's to be second so since I have a relational db, I changed this line: $db_sort{'Member'} = 'numer';
So I logged in as admin and added a record. Then I logged in as another user with a per_mem permission of 0 and added a record, but when I logged back in again as admin to test it, the record from the user with per_mem of 0 showed up as 1. I checked it out in my default.pass file and per_mem shows up as 0 still, but maybe because I logged in as admin it set the value of the Member field to 1 instead of the correct value of 0??
This is where I'm confused. I figured I could just input the value of per_mem into the 'Member' field instead of making the record form say $rec{'Member'} because then I believe that would take alot more work trying to figure out how to pass per_mem into the 'Member' field, but maybe that needs to be done??
So can anyone assist me with the correct code to use to accomplish this? Thanks!
This is the code I had:
Code:
if ($per_admin) { print qq| <TR><TD width="250"><$font_color>Member:</FONT></TD><TD align="right"> <INPUT TYPE="TEXT" NAME="Member" SIZE="11" VALUE="$per_mem" MAXLENGTH="11"></TD></TR> |;
}
else { print qq| <input type="hidden" NAME="Member" VALUE="$per_mem">|; }
which what I was trying to do is say if logged in as admin (or have admin permission), view the Member field and pass the value of per_mem into that field, if not admin, make the Member field hidden, but still pass the value of per_mem. Then I am trying to sort by the Member field for 1's to be first and 0's to be second so since I have a relational db, I changed this line: $db_sort{'Member'} = 'numer';
So I logged in as admin and added a record. Then I logged in as another user with a per_mem permission of 0 and added a record, but when I logged back in again as admin to test it, the record from the user with per_mem of 0 showed up as 1. I checked it out in my default.pass file and per_mem shows up as 0 still, but maybe because I logged in as admin it set the value of the Member field to 1 instead of the correct value of 0??
This is where I'm confused. I figured I could just input the value of per_mem into the 'Member' field instead of making the record form say $rec{'Member'} because then I believe that would take alot more work trying to figure out how to pass per_mem into the 'Member' field, but maybe that needs to be done??
So can anyone assist me with the correct code to use to accomplish this? Thanks!