<?php
-# This form requires wfpl. See: http://jasonwoof.org/wfpl
+# This form requires wfpl. If you didn't recieve wfpl along with this file,
+# see: http://jasonwoof.org/wfpl
+
+# This form was auto-generated. If you would like to alter the parameters and
+# generate a new one try this URL:
+#
+# ~metaform_url~
# This code can send form results by e-mail and/or save them to a database. See
# the next two comments to enable either or both.
$message = tem_run('~form_name~.email.txt');
$cc = '';
$bcc = '';
- email($from, $to, $subject, $message, $cc, $bcc);
+ if(email($from, $to, $subject, $message, $cc, $bcc)) {
+ tem_set('error_message', 'Due to an internal error, your message could not be sent. Please try again later.');
+ tem_sub('error');
+ $error = true;
+ }
+ }
+ if($error !== true) {
+ tem_load('~form_name~.html');
+ tem_sub('thankyou');
+ tem_output();
+ exit();
}
- tem_load('~form_name~.html');
- tem_sub('thankyou');
- tem_output();
- exit();
}
# otherwise, we display the form again. ~form_name~_get_fields() has
# already put the posted values back into the template engine, so they will
list(~php_fields~) = db_get_row('~form_name~', '~db_fields~', 'id = %"', $edit_id);
~tem_sets.tab~
} else {
- # form not submitted, you can set default values like so
+ # form not submitted, you can set default values like so:
#tem_set('~always_field~', 'Yes');
}<!--~upload_max start~-->