Is there any way I can make parts of the html code in my db visible only to those who log in as admins? ie I want to make some fields only visible/editable by admins, and also some custom links in the footer. Please let me know how this is done. Thank you.
Feb 7, 1999, 8:06 AM
Veteran / Moderator (8669 posts)
Feb 7, 1999, 8:06 AM
Post #2 of 2
Views: 1393
Let's say you want a field to be hidden from users, but editable by admin. Assuming you're not using autogenerate, put something like the following in html_record_form:
print qq|<TR><TD>Fieldname:</TD>
<TD><input type="text" name="Fieldname" value="$rec{'Fieldname'}></TD></TR>|;
}
else {
print qq|<input type="hidden" name="Fieldname" value=$rec{'Fieldname'}>|;
}
Same thing with custom links.
------------------
JPD
[This message has been edited by JPDeni (edited February 07, 1999).]
Code:
if ($per_admin) { print qq|<TR><TD>Fieldname:</TD>
<TD><input type="text" name="Fieldname" value="$rec{'Fieldname'}></TD></TR>|;
}
else {
print qq|<input type="hidden" name="Fieldname" value=$rec{'Fieldname'}>|;
}
Same thing with custom links.
------------------
JPD
[This message has been edited by JPDeni (edited February 07, 1999).]