FormMail V1.0 © 2001 Internet Express, Inc.
'; # Generic US-style date string $date = strftime("%A, %B %d, %Y at %H:%M:%S"); # List of options used by the script. $options = array('recipient','subject','email','realname','redirect','bgcolor', 'background','link_color','vlink_color','text_color', 'alink_color','title','sort','print_config','required', 'env_report','return_link_title','return_link_url', 'print_blank_fields','missing_fields_redirect'); # Read in the config file settings. $config = read_config($conffile); # If a referring URL was specified, make sure it matches one of the # domains in our referer list. $check_referer = false; if ($HTTP_SERVER_VARS['HTTP_REFERER']) { if (!is_array($config['referers'])) { $config['referers'] = array($config['referers']); } foreach ($config['referers'] as $referer) { if (eregi("^https?://([^/]*)$referer", $HTTP_SERVER_VARS['HTTP_REFERER'])) { $check_referer = true; break; } } } else { $check_referer = true; } # If the HTTP_REFERER was invalid, send back an error. if (!$check_referer) { local_error('bad_referer'); } if ($HTTP_SERVER_VARS['REQUEST_METHOD'] !== 'POST' && $HTTP_SERVER_VARS['REQUEST_METHOD'] !== 'GET') { local_error('request_method'); } # Know which variables we're pulling from. if ($HTTP_SERVER_VARS['REQUEST_METHOD'] === 'POST') { $user_vars = $HTTP_POST_VARS; } else { $user_vars = $HTTP_GET_VARS; } $Field_Order = array(); $errors = array(); foreach ($user_vars as $name => $value) { if (in_array($name,$options,true)) { $config[$name] = $value; } else { if ($output[$name] && $value) { $output[$name] = $output[$name] . ', ' . $value; } else if ($value) { array_push($Field_Order,$name); $output[$name] = $value; } $output[$name] = $value; } } # These three settings are lists of variable names. Turn them into # arrays. if (!is_array($config['required'])) { $config['required'] = parse_array($config['required']); } if (!is_array($config['env_report'])) { $config['env_report'] = parse_array($config['env_report']); } if (!is_array($config['print_config'])) { $config['print_config'] = parse_array($config['print_config']); } if (!$config['recipient']) { if (count($output) === 0) { local_error('bad_referer'); } else { local_error('no_recipient'); } } foreach ($config['required'] as $required) { # If the required field is the email field, the syntax of the email # address if checked to make sure it passes a valid syntax. if ($required === 'email' && !check_email($config[$required])) { array_push($errors,$required); } # Otherwise, if the required field is a configuration field and it # has no value or has been filled in with a space, send an error. else if (in_array($required,$options,true)) { if (!$config[$required]) { array_push($errors,$required); } } # If it is a regular form field which has not been filled in or # filled in with a space, flag it as an error field. else if (!$output[$required]) { array_push($errors,$required); } } # If any error fields have been found, send error message to the user. if (count($errors)) { local_error('missing_fields', $errors); } if (is_array($config['recipient'])) { $config['recipient'] = implode(", ", $config['recipient']); } # If redirect option is used, print the redirectional location header. if ($config['redirect']) { Header("Location: " . $config['redirect']); } else { # Otherwise, begin printing the response page. ?> <?= $config['title'] ?>Thank You >

Thank You For Filling Out This Form

Below is what you submitted to on


:

:



bgcolor="" background="" link="" vlink="" alink="" text="" Bad Referrer - Access Denied

Bad Referrer - Access Denied
The form attempting to use FormMail resides at , which is not allowed to access this cgi script.

If you are attempting to configure FormMail to run with this form, you need to add the following to referers list, explained in detail in the README file.

Add '' to your referers list.


Internet Express FormMail v1.0
FormMail
Licensed for use by Internet Express customers.
Error: Request Method
Error: Request Method
The Request Method of the Form you submitted did not match either GET or POST. Please check the form and make sure the method= statement is in upper case and matches GET or POST.

Error: No Recipient
Error: No Recipient
No Recipient was specified in the data sent to FormMail. Please make sure you have filled in the 'recipient' form field with an e-mail address. More information on filling in recipient form fields can be found in the README file.
$missing_field\n"; } ?> Error: Blank Fields
Error: Blank Fields
The following fields were left blank in your submission form:


These fields must be filled in before you can successfully submit the form.

Please use your browser's back button to return to the form and try again.