-
-
-if(isset($_REQUEST['~always_field~'])) {
- ~form_name~_get_fields();
-
- if("you're happy with the POSTed values") {
- #db_insert('~form_name~', '~db_fields~', $GLOBALS['~form_name~_fields']); # fixme
- if($GLOBALS['~form_name~_form_recipient'] != "fixme@example.com") {
- $to = $GLOBALS['~form_name~_form_recipient'];
- if(isset($_REQUEST['email']) and valid_email($_REQUEST['email'])) {
- $from = $_REQUEST['email'];
- if($_REQUEST['name'] and ereg('^[a-zA-Z0-9_\' -]*$', $_REQUEST['name']) !== false) {
- $from = "$_REQUEST[name] <$from>";
+
+function ~form_name~() {
+ if(isset($_REQUEST['~always_field~'])) {
+ list(~php_fields~) = ~form_name~_get_fields();
+
+ if("you're happy with the POSTed values") {
+ # uncomment the following lines to save the values recieved to the
+ # database. You can use ~form_name~.sql to create the database table.
+ #require_once('db_connect.php');
+ #db_insert('~form_name~', '~db_fields~', ~php_fields~);
+ if($GLOBALS['~form_name~_form_recipient'] != "fixme@example.com") {
+ $to = $GLOBALS['~form_name~_form_recipient'];
+ if(isset($_REQUEST['email']) and valid_email($_REQUEST['email'])) {
+ $from = $_REQUEST['email'];
+ if($_REQUEST['name'] and ereg('^[a-zA-Z0-9_\' -]*$', $_REQUEST['name']) !== false) {
+ $from = "$_REQUEST[name] <$from>";
+ }
+ } else {
+ $from = $to;