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