is it possible for sub build_html_record_form to know how it was called? i want to add an indication of required fields in autogeneration of forms for adding and modifying but don't want the indicator to appear in the search form. if there is a way to test whether it was called from search form or not, i could bypass the code for searches. hope this makes sense.
Jul 31, 2003, 7:32 AM
User (287 posts)
Jul 31, 2003, 7:32 AM
Post #2 of 3
Views: 2792
Below is from db.cgi.
So to try and answer your question, yes you can evaluate the $in{} to see what the user requested.
# request, do it. Otherwise send the user off to an unauthorized request page.
if ($in{'add_form'}) { if ($per_add) { &html_add_form; } else { &html_unauth; } }
elsif ($in{'add_record'}) { if ($per_add) { &add_record; } else { &html_unauth; } }
elsif ($in{'view_search'}) { if ($per_view) { &html_view_search; } else { &html_unauth; } }
So to try and answer your question, yes you can evaluate the $in{} to see what the user requested.
Code:
# Main Menu. Check to see what the user requested, then, if he has permission for that # request, do it. Otherwise send the user off to an unauthorized request page.
if ($in{'add_form'}) { if ($per_add) { &html_add_form; } else { &html_unauth; } }
elsif ($in{'add_record'}) { if ($per_add) { &add_record; } else { &html_unauth; } }
elsif ($in{'view_search'}) { if ($per_view) { &html_view_search; } else { &html_unauth; } }