-function _~form_name~_main() {<!--~opt_http_pass_2 start~-->
- # To remove password protection, just delete this block:
- if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != AUTH_USER || $_SERVER['PHP_AUTH_PW'] != AUTH_PASS) {
- header('WWW-Authenticate: Basic realm="' . AUTH_REALM . '"');
- header('HTTP/1.0 401 Unauthorized');
- echo '401 Unauthorized';
- exit;
+function ~file_name~_display_main() {
+ $id = format_int($_REQUEST['~file_name~_id']);
+ unset($_REQUEST['~file_name~_id']);
+ if(!$id) {
+ message('Error: Broken link');
+ return './~file_name~';
+ }
+ $row = db_get_assoc('~table_name~', 'id,'.~file_name upper~_DB_FIELDS, 'where id=%i', $id);
+ if(!$row) {
+ message('Error: ~singular cap~ not found');
+ return './~file_name~';