JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
metaform working. added some encodings and formatters.
[wfpl.git] / metaform / template.php
1 <?php
2
3 require_once('code/wfpl/template.php');
4 require_once('code/wfpl/format.php');
5 #require_once('code/wfpl/db.php'); # fixme
6
7 function ~form_name~_get_fields() {
8         $GLOBALS['~form_name~_fields'] = array();<!--~formats start~-->
9
10         $value = format_~format~($_REQUEST['~name~']);
11         tem_set('~name~', $value);<!--~db_field start~-->
12         $GLOBALS['~form_name~_fields'][] = $value;<!--~end~--><!--~end~-->
13 }
14         
15
16 if(isset($_REQUEST['~always_field~'])) {
17         ~form_name~_get_fields();
18
19         if("you're happy with the values") {
20                 #db_insert('~form_name~', '~db_fields~', $GLOBALS['~form_name~_fields']); # fixme
21                 header('Content-type: text/plain');
22                 print "e-mailing this: \n\n";
23                 tem_output('~form_name~.email.txt');
24                 exit();
25         }
26 }
27
28 tem_output('~form_name~.html');
29
30 ?>