Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 5.8   Updated Sunday, July 5th, 2009 at 8:20pm

Secure PHP Form Mailer Script

This is the PHP version of my secure form mailer script. This script has a wide range of features including: an easy to use dynamic form generation system (any number of fields, in any order), multiple recipients, multiple file attachments, optional auto reply feature, an image verification system, numerous security features (including protection against email header injection), a message template system, multiple languages, and too many other things to list. This script was designed to be easy to use, while still being extremely flexible. If you just want a simple contact form, you can set one up with just a few clicks. For those of you who need something a bit more advanced, you can completely customize script plugin to fit your needs – whether it is 5 fields or 500. A WordPress plugin version is also available. ReCaptcha support has also been added, as well as support for storing the data in a delimited file.

You can see a very basic implementation of the WordPress plugin version of this script on this site’s contact page.

Notice: WordPress Users

Information on the WordPress plugin version of this script

Languages

As of the latest release, this script contains language files for:

English, Belarussian, Brazilian Portuguese, Catalan, Czech, Danish, Dutch, Estonian, Finnish, French, German, Greek, Italian, Japanese, Norwegian Bokmaal, Polish, Portuguese, Romanian, Russian, Slovak, Slovene, Spanish, Swedish, Turkish, Vietnamese

If you would like to submit a language file please contact me.

WordPress vs PHP Versions

To make things easier to find, the two versions of this script share much of the same documentation. While the basic features are the same, there are several differences, so be sure to reference the proper page.

Table of Contents

Due to the size of this page, I have split everything up into sections:



Download

  If you have found this page useful, please consider donating. Thanks!



Changelog

Since both the WordPress and non-WordPress versions of this script are updated together, the changelog below reflects both versions.

  • 07-05-09 – v5.8 Added Estonian language. Added code to check for duplicate field names. Can now use commas in checkbox descs. Fixed garbled auto-reply messages. Adjusted the displaying of uploaded file names in the email message. mb_encode_mimeheader error in WP fixed. Other adjustments to email headers. Added ‘id’ declaration to select boxes. Fixed incorrect example code in the instructions. Other minor changes.
  • 02-22-09 – v5.7 Fixed issues regarding the saving of attached files, data selection values not being recorded, and various minor fixes. Inline styles have been removed from the two field items that contained them.
  • 10-19-08 – v5.6 Added javascript date chooser field. Added html code field. Adjustments for better character set support. Fixed bug with spaces in selrecip. Commas can now be used in check boxes, radio buttons, and select boxes (see field info below). Timestamp option added for saving to data file. New email validation code (from http://code.google.com/p/php-email-address-validation/). New language added: Vietnamese
  • 09-18-08 – v5.51 Captcha now displays properly in Safari and Chrome. All of the auto-reply issues should now be resolved. Few changes to headers for compatibility.
  • 08-24-08 – v5.5 Fixed various undefined index errors, code changes to improve xhtml validity, attachments can now be saved to the server (not just emailed), improved email header handling for language support, can now show url (of form) in message, fixed issue with required select boxes, added Belarussian, Czech, and Japanese languages, clickable labels for radio and checkbox items, and various other fixes.
  • 05-13-08 – v5.41 Added support for saving form data to a delimited file. Fixed a few issues including the loading of recaptcha files, and attachment support.
  • 11-25-07 – v5.4 Added support for ReCaptcha, manual form code entry, 5 new languages (Catalan, Danish, Polish, Romanian, and Turkisk), several html and css tweaks, and other misc. updates.
  • 07-27-07 v5.33 – Few minor bugs fixed. Finnish language file added.
  • 07-08-07 v5.32 – Error messages affecting form alignment issue resolved. Italian and Slovak language files added.
  • 06-18-07 v5.3 – ‘undefined index’ errors fixed, image verification adjustments, p tags removed from fieldsets, changes to help html validity, various other fixes.
  • 05-09-07 v5.25 – ‘Thank you’ message now allows for form field inputs as well.
  • 05-08-07 v5.24 – Auto-reply message now allows for form field inputs. Language selection issue resolved. str_replace errors (on certain servers) fixed. Norwegian BokmÃ¥l language file added.
  • 05-01-07 – Not a version update. Greek and Swedish language files added.
  • 04-18-07 v5.23 – Renamed email verification function (to fix conflicts with other scripts). The GD check is now disabled if you are not using image verification. Added two new language files – Portuguese and Russian.
  • 04-18-07 – Not a version update. Brazilian Portuguese language file has been added.
  • 04-03-07 v5.22 – Email generation code has been modified to try to work with more servers. French language file has also been updated.
  • 03-28-07 v5.21 – Highly recommended update – Fixed an issue with the verification code not being handled properly. Nothing else has been changed.
  • 03-25-07 v5.2 – Email generation improved – should work better in more email clients. Many issues with message generation and field types have been fixed. Better support added for field requirement options. CSS for various fields updated. Issue with submit button fixed. Dutch and French language files added. Checkbox and drop-down issues resolved. Email verification method improved. Undefined index errors fixed, and much more. Be sure to read the updated instructions for the field types.
  • 03-13-07 v5.1 – Lots of updates: Slash escaping has been improved, p tags are now added around form elements, each form instance can have its own language setting, the language selection issue has been fixed, improved foreign character support in messages, check box handling improved, and a new optional auto reply feature has been added.
  • 02-06-07 v5.0 – This is a major update from version 4, and because of this, I have completely re-written this page, and removed the old changelog to save space.


Installation

  • 1) Download and uncompress dd-formmailer.zip
  • 2) Upload the entire dd-formmailer directory to your server
  • 4) Configure your options (explained below)
  • 5) Add the form to your page (explained below)


Required Configuration

While this script is highly configurable, some of you may just want to get up and running quickly with a simple (and secure) contact form. If so, these are the minimum options you need to configure within the file:

Standalone Option

$standalone – If you plan to use this script by itself (not included from another PHP file), set this option to TRUE, and it will generate a proper html header and footer. If you want to change the basic header and footer, they are found near the bottom of this script.

Path to CSS

$path_to_css – If you are using the standalone option, enter the relative path to your CSS file so it can be declared properly in the header. For those of you including this script in another PHP file, be sure to manually add the CSS declaration in the header section of your page, like this:

<link rel="stylesheet" href="(path to dd-formmailer.css)" type="text/css" media="screen" />

If you plan to use the javascript date field, you will also have to include the following line:

<script type="text/javascript" src="(location of date_chooser.js)"></script>

Language Setting

$language – The relative path to the language file you want to use.

Full URL to Script

$script_path – The full URL to dd-formmailer.php (or whatever you have renamed it to)

Full URL to Contact Page

$path_contact_page – If you are running this script in standalone mode, leave this blank. Otherwise, enter the full URL to the page that is displaying the form

Recipient Data

$recipients – If you are just sending email to a single address, enter it here. For more advanced usage such as multiple recipients, CC, BCC, etc.. more information is below

The other settings are optional, and are explained below.



Other Configuration Options

This is a listing of the other configurable options in the script. These are optional, but allow for much greater customization

Form Structure – This is where you define the fields that will be used on this form. There are a lot of options available for this, and they will be explained further down as well

Manual Form Code – This is a very advanced option that has its own section on this page.

Wrap messages – This option wraps message lines to 70 characters to comply with RFC specifications

Save attachments – If enabled, attached files will be saved to a directory on the server instead of attached to the email.

Save attachment path – Where files will be saved, if attach_save is enabled. This is the full path on the server, with a trailing slash. Directory must have write permissions. Example: /home/user/public_html/uploads/

Show required – If enabled, required fields will be marked with an asterisk

Show URL – If enabled, the URL the script is running from will be added to the message

Show IP and Hostname – If enabled, the visitor’s IP and hostname are added to the message

Special Fields – Sender name, Sender email, and Email subject – These options help generate the email headers. If you enter a field name, it will be replaced by user input from that field. For example, if you have a form field called fm_name and you use that as the Sender name option, the visitor’s name will be used as the From field in the email. You can also combine them. If you have a field called fm_firstname and fm_lastname you could enter ‘fm_lastname, fm_firstname’ – For the Sender email option, just use your email field

Max upload size – This allows you to set the maximum file size (in bytes) for attachment uploads. This option only applies if the setting is lower than the value already set in your php.ini file

Message Structure – This feature is optional. If left blank, the script will generate the email message itself, which will include all the data the visitor submits. If you choose to use this option, it will act as the message template. Simply enter your custom text, including your field names. When the message is generated, the field names will be replaced by the user input from those fields. Note: Since the script will just do a search and replace for field names, be sure they are unique enough. Example: A check for fm_message2 would also get triggered by fm_message when the script adds in the input.

Success Message – This is the text that is shown after the email has been sent. You can also use field names in this, and the user input from those fields will be used to generate the message.

Auto Reply – This is an optional feature that allows you to automatically send a pre-defined message back to those who contact you. More information on this is below

Image Verification Method – There are three choices for image verification. It can be disabled, you can use the script’s built-in system (a simple captcha – requires GD support on the server), or you can use the ReCaptcha system (requires signing up for a free account at recaptcha.net)

Basic Method Options – If using the basic image verification method, you can choose the text and background color for the image (3 or 6 digit hex codes). By default, the script will try and choose the best file format for the verification image, but if it gives you any problems, you can manually specify the format to see what works best for your server.

ReCaptcha Method Options – If using the ReCaptcha image verification method, you must enter the public and private keys given to you at the ReCaptcha website. These are used to generate the verification form, and the keys are specific to the website under your account (meaning if you use this script on multiple sites, you need a set of keys for each).

Save Data to File – When enabled, the form input will be saved to a delimited file.

Still Send Email – When using the delimited file feature, this option determines whether or not the script still sends the email.

Data Path – The path to the file the data will be written to – relative to the script’s directory. Be sure to give this file write access.

Delimiter – Fields will be separated by this character. If this character is found in the actual data, it will be removed for simplicity.

Newlines – Newlines in input, such as text areas, will be replaced by this, to keep the data on a single line in the file.

Timestamp – Adds the date/time to the beginning of each line in your data file. This uses the PHP date format. Leave blank to disable.



Other Customizations

With the exception of the text defined in the options, all text visible to the visitor is contained within the language file.

Visual changes to the form can be made in the included CSS file. The class names used in the examples below already exist within the CSS.



Usage

If you are using the standalone option, all you have to do is open the URL to the script file in your browser.

If you are not using the standalone option, you can include the script in your existing PHP file with the following code:

<?php include('dd-formmailer.php'); ?>

Be sure to use the relative path to the script file.



Advanced Recipient Options

As mentioned above, if you want to send the messages to a single recipient, just enter the email address in the recipients option. To send to multiple recipients, separate the addresses with a | (pipe) character, and use one of the following prefixes for each: to= cc= bcc=

Examples:

to=user1@domain.com|to=user2@domain.com
to=user1@domain.com|cc=user2@domain.com
to=user1@domain.com|cc=user2@domain.com|bcc=user3@domain.com

You can have as many of each type (to, cc, bcc) as you like, and they can be in any order, although the first one in the list is the always the primary recipient, and must use to=

For those of you who want to let the vistor choose the recipient from a drop-down box, first you must enter selrecip in the recipients field. Then you must add a new line in the form structure box. Example:

type=selrecip|class=fmselect|label=Recipient|data=(select),
User1,user1@domain.com,User2,user2@domain.com

The type must be selrecip, but you can use whatever you like as the CSS class, and label. The first item in the data parameter is the default (unselected) option. After that are the names and email addresses. You can add in as many as you like – just keep them in the proper order (name,email,name,email,etc..). Only the names are visible within the HTML for privacy reasons.

The ‘(select)’ item is the default selection, which the user must change to submit the form. You can change the ‘(select)’ text if you choose.



Advanced Form Structure

This script uses a dynamic form generation system, which means that by simply adding a new line to the form structure, you will have a new field in your form. You can have as many fields as you like, and in any order. The only field type that you must absolutely have is the verify field if you are using the image verification option. All of the fields are explained below, with examples. Separate each field type with a single newline in the form structure option. (Some of the examples below are bit long, so they are wrapped to the next line – be sure that the only newlines are after each field type when adding them to your form structure.)

These are the different parameters that apply to most of the field types (Special exceptions and parameters unique to a particular field are listed under each field type):

  • type – This tells the script what type of field you are adding.
  • class – The CSS class used to style the field. The classes used in the examples below already exist in the CSS file.
  • label – Text that is shown next to the field.
  • fieldname – The name of the form field (must be unique).
  • max – Maximum number of characters allowed.
  • req – (OPTIONAL) If you want to require a field, set this to true. If not, do not add it.
  • default – (OPTIONAL) This allows you to specify the default value of a field.

TEXT

This is a standard text input field.

type=text|class=|label=|fieldname=|max=|[req=true]|[ver=]|[default=]

The text field type has a special parameter – ver – which can be used to verify the input. You can choose email (which checks that the input is a proper email address) or url (which checks that the input is not only a proper URL, but that it actually exists). If you do not want to use either validation option, do not add this parameter.

Examples:

type=text|class=fmtext|label=Name|fieldname=fm_name|max=100|req=true 

type=text|class=fmtext|label=Age|fieldname=fm_age|max=100|
default=Enter your age! 

type=text|class=fmtext|label=Email|fieldname=fm_email|max=100|req=true|
ver=email 

type=text|class=fmtext|label=URL|fieldname=fm_url|max=100|ver=url

DATE

This is a javascript pop-up date chooser.

type=date|class=|label=|fieldname=|[req=true]

This field type generates a text box with a calendar icon next to it. The user can enter a date manually, or click on the icon to see a small calendar that they can choose a date from.

To change this image, just replace calendar.gif in the script directory. Either give your file the same name, or search and replace the name in the script file.

Example:

type=date|class=fmdate|label=Event Date|fieldname=fm_date|req=true 

HTML

This field type lets you insert html, or other code, anywhere in your form.

type=html|text=

Example:

type=html|text=<p>Hello!</p> 

PASSWORD

This is a standard password field. It is exactly like a text field, except it shows asterisks when the user types.

type=password|class=|label=|fieldname=|max=|[req=true]|[confirm=true]

The password field type also has a special parameter – confirm – which if set to true, it duplicates the password field, so that the visitor has to confirm their input. If you do not want to use this, do not add the confirm parameter.

Examples:

type=password|class=fmtext|label=Password|fieldname=fm_pass|max=100|
req=true|confirm=true
 
type=password|class=fmtext|label=Secret Word|fieldname=fm_secret|max=100

TEXTAREA

This is a standard text area, for multiple lines of text.

type=textarea|class=|label=|fieldname=|max=|rows=|[req=true]|[default=]

The textarea field type has a special parameter – rows which defines the number of rows in the field (required for valid html).

Examples:

type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|
max=1000|rows=6
 
type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|max=1000|
rows=4|req=true
 
type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|max=1000|
rows=10|req=true|default=Type here!

WIDETEXTAREA

This is exactly the same as the standard textarea, except that it’s wider, and the label is above it instead of to the side.

type=widetextarea|class=|label=|fieldname=|max=|rows=|[req=true]|[default=]

Example:

type=widetextarea|class=fmtextwide|label=Message|fieldname=fm_message|
max=1000|rows=10|req=true

* Note that the normal textarea, and wide textarea fields use a different CSS class for formatting.


VERIFY

This field is required if you are using the basic verification method. It does not apply if you are using the ReCaptcha method. It is used for placement of the verification image (and associated text box) in the form.

type=verify|class=|label=

Example:

type=verify|class=fmverify|label=Verify

FULLBLOCK and HALFBLOCK

These are not standard form fields, but simply a way you can add text to your form. The full block is as wide as a wide textarea, while the half block is aligned with other standard fields. You can use basic HTML in your text if you like.

type=fullblock|class=|text=
type=halfblock|class=|text=

Examples:

type=fullblock|class=fmfullblock|text=This could be some sort of 
introduction message.
 
type=halfblock|class=fmhalfblock|text=This could be used to explain a field 
in greater depth.

OPENFIELDSET and CLOSEFIELDSET

These do just what the name implies – they open and close a fieldset in your form so you can help group fields together. It also allows you to specify a legend for the fieldset (required for valid HTML).

type=openfieldset|legend=
type=closefieldset

Examples:

type=openfieldset|legend=Your Information
 
(other field would go between these)
 
type=closefieldset

CHECKBOX

The checkbox field can be used to generate a single checkbox, or a group of them. The usage is a bit different than the other fields.

type=checkbox|class=|label=|data=
(fieldname),(text),(checked),(REQUIRED),
(fieldname),(text),(CHECKED),(REQUIRED)...

As you can see, the checkbox data is a comma separated list of four items per checkbox:

  • fieldname – A unique fieldname for each checkbox in the form.
  • text – The text shown to the right of each checkbox.
  • checkedtrue or false. This allows you to make checkboxes checked by default.
  • requiredtrue or false. If true, it means that the user must check the box to send the message. Mainly useful for ‘check here to agree’ type situations.

*NOTE* Because this field type uses commas to separate data, if you would like a comma to be displayed in your data, simply use two. It will be replaced later in the code.

Examples

type=checkbox|class=fmcheck|label=I Agree|data=fm_agree,I agree to the 
terms,false,true
 
type=checkbox|class=fmcheck|label=Interests|data=fm_i1,Computers,false,
false,fm_i2,Art,false,false,fm_i3,Music,false,false

RADIO

This field generates a group of radio buttons. Radio buttons are similar to checkboxes, except that they are treated as a group, and only one option may be selected.

type=radio|class=|label=|fieldname=|[req=true]|[default=]|data=(text),(text),
(text)...

The req and default items are optional. req, if set to true, makes the field required. default can be set to the option number you want to be selected by default (starting at 1).

*NOTE* Because this field type uses commas to separate data, if you would like a comma to be displayed in your data, simply use two. It will be replaced later in the code.

Examples:

type=radio|class=fmradio|label=Gender|fieldname=fm_gender|data=Male,Female
 
type=radio|class=fmradio|label=Color|fieldname=fm_color|req=true|default=1|
data=Unspecified,Red,Green,Blue

SELECT

The select field generates either a standard drop-down box, or a multi-select box, depending on the multi option. Option groups are supported as well.

type=select|class=|label=|fieldname=|[multi=true]|[req=true]|data=(#group),
(text),(text),(#group),(text)...

The multi and req options are optional.

If the field is required, the first option you have in the data paramater will be the default, which tells the user they need to select one of the options. If they do not change the default option, and it is required, they will receive an error.

The data field is just a list of the options, separated by a comma. To define the start of an option group, just prefix the group name with a # as shown below.

*NOTE* Because this field type uses commas to separate data, if you would like a comma to be displayed in your data, simply use two. It will be replaced later in the code.

Examples:

type=select|class=fmselect|label=Age|fieldname=fm_age|req=true|
data=(select),0-30,31-60,61-90,91-120
 
type=select|class=fmselect|label=Colors|fieldname=fm_colors|
multi=true|req=true|data=Red,Green,Blue
 
type=select|class=fmselect|label=Choose|fieldname=fm_choose|
data=#Category1,item1,item2,#Category2,item3,item4

FILE

The file field generates a file upload box. As with all other fields, you can add as many of these as you like, as this script supports not only attachments, but multiple attachments. The only thing to keep in mind is that you may need to find out the limit your server has set for file upload sizes.

type=file|class=|label=|fieldname=|[req=true]|[allowed=1,2,3]

The allowed field is optional, and lets you define a (comma separated) list of file extensions that are allowed to be uploaded. Otherwise, all file types will be allowed.

Examples:

type=file|class=fmfile|label=Upload|fieldname=fm_upload
 
type=file|class=fmfile|label=Upload|fieldname=fm_upload|req=true|
allowed=jpg,jpeg,gif,png


Manual Form Code

This feature allows you to manually specify the code used to generate your form. By default, this script uses the form structure information to dynamically generate the form. While this makes it easier for most people, since they do not have to write any code, it can limit those who need a bit more flexibility in their form structure.

Important Notice: Because this method means you will be writing the form code yourself, and it will not be generated by the script, there is no way for it to automatically insert the PHP code needed to put the user’s input back into the form when there is a validation error. It is just not possible for this to be done automatically due to the nature of the option. The only way this can be accomplished is if you know enough about PHP to insert the code manually yourself. In other words, this is a very advanced option – only for those who are very familiar with HTML forms and PHP.

  • 1) Customize your form using the ‘Form Structure’ option as you would normally – this is required even when using the manual code entry, as it allows for processing of the form.
  • 2) Be sure you have all your options exactly as you want them, and view your newly created form page.
  • 3) View the source of the page, so you can copy the generated html. The code you need is between the following lines:
    <!-- START of Dagon Design Formmailer output -->
    <!-- END of Dagon Design Formmailer output -->
  • 4) You can now customize this form code however you like, as long as the core elements of the form and fields are still in place.
  • 5) Enter your new code into the ‘Manual Form Code’ option. (PHP VERSION NOTICE: Depending on your form code, you may have to ‘escape’ single or double quotes, as you are assigning this code as a string value to the $manual_form_code option!)
  • 6) If everything worked properly, your page will now use the custom form code. Once again, the standard form structure option is still required, as it is still for processing of the form.

You can also adjust the included CSS file to better fit your needs, or completely clear it out and manually create an entire new CSS structure for your task. Keep in mind that if you change any field items (or any options which affect the form code generation), you will have to repeat this process.

To disable the manual form code feature, just clear out the option for it.



Auto Reply Feature

The options page for each instance includes fields to define an auto reply message. This is a pre-defined message that is sent back to the visitor.

To use this option, simply enter the name, email address, subject line, and message for your auto response. To disable this feature, just leave the message field blank.

You can also use field names in the auto reply message, and the user input from those fields will be used to generate the message.



Saving Data to a File

This option allows you to save the form input in a delimited file. Please see above for a full explanation of the options.

With the PHP version of this script, the path to the data file is relative to the location of the script. Be sure to give this file write access.



Other modifications

Redirect after form submission – Method 1

It is possible to use Javascript to redirect the user after the form has been filled out. While this method is not 100% valid (Javascript redirection should go in the HEAD section of the page), it works. To add this feature, first find the following line in the script:

$o .= $sent_message;

And replace it with this:

$o .= '<script><!-- 
window.location= "http://www.mysite.com/" 
//--></script>';

(where mysite.com is the URL you want to redirect to)

Redirect after form submission – Method 2

This is another method you can use to redirect the user after the form has been submitted. First, find this line:

$o .= $sent_message;

And after it, add this:

$o .= '<META HTTP-EQUIV="REFRESH" CONTENT="4;URL=http://www.mysite.com/">';

Where ‘4′ is the number of seconds to wait before refresh, and the ‘http://www.mysite.com/’ is the URL you want to redirect to.

Passing values to the form

To allow values to be passed directly to the form, all you have to do is change all references of $_POST to $_REQUEST (The REQUEST superglobal contains the values of both POST and GET items)

Prevent form data from being resubmitted upon refresh

This feature is included in the WordPress plugin version, but not in the PHP version, because of how it has to be used. To enable the feature when using the script in standalone mode, add the following code after the PHP declaration at the top of the script:

if (count($_POST) > 0) {
  $lastpost = isset($_COOKIE['lastpost']) ? $_COOKIE['lastpost'] : '';
  if ($lastpost != md5(serialize($_POST))) {
    setcookie('lastpost', md5(serialize($_POST)));
    $_POST['_REPEATED'] = 0;
  } else {
    $_POST['_REPEATED'] = 1;
  }
}

If you are not using the standalone option, you must add that code at the very top of the PHP file you are calling the script from. Add PHP tags around it if needed. Just make sure there is no extra whitespace around the PHP tags.

Modifying the script to use HII for image verification

Miro has posted instructions for users wanting to use HII: Read the comment. Notice: Modifications listed in the comments may not apply for new versions of the script.

Using SELRECIP and BCC together

The easiest way to do this, is to find the following line in the script:

$send_status = mail($send_to, $email_subject, $msg, $headers);

If you are using SELRECIP, the message will be sent to whoever the visitor chooses. If you would also like the message to go to someone else, no matter who is chosen, just duplicate that line like so, adding in the address of the secondary recipient:

$send_status = mail("user2@domain.com", $email_subject, $msg, $headers);



Troubleshooting

Fields not working properly/Form is not displaying properly

As stated above, each field item needs to be on a single line in your form structure. Many of the examples above are long, so they do not show up on a single line. Be sure to remove any linebreaks when adding them to your form. One form field statement per line.

Verification image not showing up

The first thing to do is check to make sure your paths are set correctly in the options.

This script automatically chooses the best file type to generate the verification image. If your verification image is not displaying, the problem could be that your server will not properly generate that type of file. You can manually set this using the ‘Force image type’ option in the script. It allows you to manually specify jpeg, gif, or png.

Try all the options to see which works best for you.

Problems sending email

The most common question I receive is ‘Why am I not receiving email from the script?’

There are many reasons this can happen. The first thing to do is make sure you have access to the PHP mail function on your web server, and that there are no restrictions in place that might prevent certain features of this script from working. If you are not sure, please ask your host for information. Unfortunately, I am not able to spend the time troubleshooting general server issues for everyone.

Also try having the script send the messages to another email address (on another domain), just to be sure the problem is not with your email account.

If you believe you can use the PHP mail function and have already tried a different email address, create a small PHP file with the following contents (be sure to use your own email address):

<?php mail('you@domain.com', 'test subject', 'test message'); ?>

Open the file in your browser and then check your mail. If you did not receive the message, something is not set properly on your server, and the trouble is not with this script. Even if other mail scripts work for you, that does not mean this one will, as there are several methods to send mail in PHP.

If you do receive the message, it most likely means that your server is configured to not allow the use of the fourth parameter (extra headers) in the mail() function. To work around this, replace this line:

$send_status = mail($send_to, $email_subject, $msg, $headers);

With this:

$send_status = mail($send_to, $email_subject, $msg);

The only downside is that certain features (such as some header information, and the ability to send to multiple recipients) will be disabled. You may be able to contact your host and have them change this though. Many hosts add in this restriction for security reasons, to protect against unsafe scripts.

Lastly, some servers require an extra parameter for the mail function that specifies who the message is from. In many cases, this must be an email address on the server itself. Example:

$send_status = mail($send_to, $email_subject, $msg, $headers, '-f user@domain.com');

‘Headers already sent’ error

Another common question is the ‘headers already sent’ error message. Without getting into the details, this generally happens when something is output to the browser before a call to set_cookie, header, or a number of other PHP functions. Be sure there is no extra whitespace at the top of your file.

Mail headers showing up in message body / attachments not working

This issue can be caused if your server does not like the return/newline character set being used to end lines of the email headers. If you are experiencing this problem, try changing this line:

if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");

To this:

if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\n" : "\n");

If you require special SMTP settings for mail to be sent

If you have to manually specify the SMTP settings, you can do so with the following code. This is only recommended for advanced users.

ini_set("SMTP","mail.MYDOMAIN.com");
ini_set("smtp_port","587");
ini_set("username","MYUSERNAME@MYDOMAIN.com");
ini_set("password","MYPASSWORD"); 
ini_set('sendmail_from', $sender_email);
$send_status = mail($send_to, $email_subject, $msg, $headers);
ini_restore('sendmail_from');

(Just search for the reference to the mail() function to see where to add it)

Conclusion

Please be sure to read the entire article before asking a question. I spend a lot of time on the scripts and plugins available on this site, and it can be hard to keep up with all the requests. If you need modifications or a custom version, please contact me. Thanks for reading!

  1. 1853
    John H

    For those of you who are trying to get the standalone version to update a table on a mysql database, after loads of searching and playing I have got it to work like this. I added this code:

    $con = mysql_connect(”host”,”user”,”password”);
    if (!$con)
    {
    die(’Could not connect: ‘ . mysql_error());
    }

    mysql_select_db(”dbname”, $con);
    $sql=”INSERT INTO tablename (fm_firstname, fm_lastname, fm_email, fm_etc, fm_etc)
    VALUES
    (’$_POST[fm_firstname]‘,’$_POST[fm_lastname]‘,’$_POST[fm_email]‘,’$_POST[fm_etc]‘,’$_POST[fm_etc]‘)”;

    if (!mysql_query($sql,$con))
    {
    die(’Error: ‘ . mysql_error());
    }

    mysql_close($con);

    after this bit:

    $o .= ‘‘;

    } else {

    in the script around line 1750 ish.

    Not sure if its the best way to do it, but I found that it wont update the db unless the form is filled in correctly, which is what I wanted.
    Hope this helps.

  2. 1852
    yamiza

    The script is not working, I’ve checked everything and it seems alright… It won’t send the e-mail to me.

  3. IMAGE SUBMIT BUTTON

    Trying to replace the submit button with an image, working fine in FireFox, Opera & Safari, but no luck in IE. Any suggestions?

    <input type="image" src="/images/btns/submitRedBtn.gif" name="form_submitted" value="SUBMIT" alt="SUBMIT" class="button">

  4. Is there any way to style the input box (in FF) for the Browse button: input#fm_upload.fmfile? If I could just make the borders plain black 1px lines, even that would help.

  5. Sure, I can have fun drinking, but I need a place to walk and hike and get away from cement. ,

  6. Preparing your postsThere are four ways to post content to Posterous. ,

  7. The certain and possible losses associated with unilateral and multi lateral political actions need to be examined. ,

  8. 1846
    Suzy

    Has anyone managed to get the form fields to save to a data file? I have tried using a .txt file and a .csv file with 777 permissions but no fields are populating. The $save_path = ‘data.csv’; is relative to the dd-formmailer.php file. I have set $save_to_file = TRUE; and $save_email = TRUE; I have not modified anything below ** END OF OPTIONS. Can anyone give me any advise or tell me if I am missing anything? Thanks.

  9. What about Autowin Book Club? ,

  10. 1844
    Jax

    I’m getting an error that reads:

    Warning: mail() [function.mail]: SMTP server response: 553 sorry, your mail was administratively denied. (#5.7.1) in D:\Hosting\3043566\html\wp-content\plugins\dd-formmailer\dd-formmailer.php on line 496

    Where exactly is line 496?

  11. I have been using this plugin for a few months without problem, but now users are getting the following error message when submitting forms: “No verification code generated”. I would be appreciative if anyone can assist with info to help fix. Thanks in advance.

  12. Hi guys, anyone found a solution yet for linking to a custom errorpage? or even better staying on the same page as the submit form but highlighted the error fields?

    Highly appreciated

    Vincent

  13. 1841
    Steve

    Firstly this is a great script and easy to set up for normal implementations.

    One observation regarding the advice above to change “_POST” to “_REQUEST” to prepopulate fields – my reading of the script is that this won’t work even if values are passed in the query string because it only populates data into the form if the “$form_submitted” variable is set, so it needs some tweaks elsewhere in the code too. (At least that’s what I found on my install but I might be missing something!)

  14. I noticed from your script that i just now downloaded that you have incorporated UTF-8 encoding into the forms message fields.

    However, the Subject line is not coming out in UTF-8 as i just tested with some German letters.
    Where in the script would i have to add what lines of code to also turn the subject line output into UTF-8 format?

  15. 1839
    Patrick Quirke

    I need a the reply message to display what checkboxes the user have checked, how can i do this?

  16. Vielen Dank für diesen Vorschlag. Ich schicke Dir einen Gruß aus Deutschland.

  17. Vielen Dank für diesen Vorschlag. Ich schicke Dir einen Gruß aus Deutschland.

    Thanks for the suggestion. I send you regards from Germany.

  18. 1836
    Rui

    Hello thank for this lovely piece of code. How can I display a hidden text field

  19. Great script. I am helping re work a community web site http//:www.wings.net.nz and downloaded and tested your script using both basic and recaptch verification within minutes on my own site, great instructions and easy to use. Thanks for the help.

  20. Unfortunately I found that the date-picker is not working in firefox for mac. Anyone know a workaround

    Still trying to solve the custom error page problem. Just dont know where to put the redirecting script

  21. Guys I think I found the solution for the thankyou page!!

    <html>
    <script>
        location = "http://yourdomain/yourthankyou.php";
    </script>
    </html>
    does the trick!!

    Paste it in the dd-formmailer.php in the $sent_message ='';

    Now I need to figure out the damn error page

  22. sorry the first link is: http://www.holandaluz.com/request-quote.php

    Vincent

  23. 1831
    Simon

    We are having some problems getting the form to work when we parse it through to another page. If a field is required it displays

    DDFM_ERRORMSGDDFM_MISSINGVER
    DDFM-REQUIRED_TAG

  24. 1830
    cisono

    I was wondering if this script is really secure? I am using a version from last year and my site has been “hacked”. By this I mean that my *.html files have somehow acquired an <iframe src="… section which downloads trojans and my website has become a google-reported attack site :-(

    I am not blaming your script, but just wanted to check if you would recommend updating to the latest version (and is there an easy way to do this, other than reinstalling and redoing all the customisation).

    Cheers.

  25. how to make the attachment works?

    I currently added the following to $form_struct

    type=file|class=|label=|fieldname=|[req=true]|[allowed=1,2,3]

    but my page at http://hipfiles.com/contact.php is not sending attachment. why?

  26. thanks … i will use this script on my site at http://hipfiles.com – a powerful file search engine soon

  27. 1827
    Rob

    Hi,

    Trying to get this to work. I’ve configured formmailer.php but don’t understand how to reference the file within my contact.html page.

    Thanks,

    Rob.

  28. 1826
    Robert Cook

    After some additional testing, I’ve found that the “Including the Name of the Person Being Sent to When Using selrecip” update chokes on ampersands. Escaping the ampersand didn’t work for me. I’ll freely admit that I have no idea how to fix this, so I’ve solved the problem by removing ampersands from my selrecip options. Perhaps someone better at PHP than me can fix my fix?

  29. 1825
    Robert Cook

    I’ve had some success in figuring out a couple of requests from the comments. (Sorry if your request isn’t covered here; I’m only working on the ones I need myself.) I’m not working with the most current version (using version 5.7 with a boat-load of customization), so I apologize in advance if any of this is fixed/addressed in 5.8.

    These fixes work for me, but don’t come with a guarantee they’ll work for you. :)

    Adding Line Breaks to the Auto-Reply Message:

    Everywhere you want a line break, insert the following:

    ' . PHP_EOL . '

    If you want more line breaks, add PHP_EOL multiple times, with a . in between each one.

    Sending to Additional Recipients When Using selrecip:

    This one was actually sort of answered way back in Comment 1238, but is worth repeating. Find the following line:

    $recipients = $sel_recip;

    Immediately after that line, add this line:

    $recipients .=',name@address.com';

    Replace “name@address.com” with the email address you want it to actually go to. This adds an extra address in the To: field, and doesn’t allow for CC: or BCC: but hey, it’s better than nothing.

    Including the Name of the Person Being Sent to When Using selrecip:

    In the first “case ’selrecip’:” section add the following lines before the “break;”:

    
    $csv .= str_replace($save_delimiter, ' ', $t) . $save_delimiter;
    $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end;
    $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure);
    $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message);
    $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message);
    

    I haven’t been able to figure out how to get the selrecip result to show up in the auto-reply. I’m working on it, but I’m beginning to think it’s beyond my ability. (I’m a PHP hacker, not a PHP programmer. This is the reason my fixes are brute force, far less elegant than the original script.)

    Also, I haven’t been able to figure out how to get the email address from selrecip to show up with or instead of the name, but right now, just the name showing up is better than nothing.

    If I figure either of these out, I’ll post them here.

  30. 1824
    keir

    ” $_POST[fieldname] ”

    Where in the code do you insert this?

  31. If you’re using the manual form code option and want the form to “remember” input data, use this as a field’s value:
    $_POST[fieldname]

    This way, when the form produces an error because a required field has not been filled in, the user does not have to enter everything a second time.

  32. 1822
    Ward B

    How can I add the dropdown ’selrecip’ field to the email message that is sent. The name selected would be best but the email address would be sufficient. I tried to add a fieldname to the first line and then build my own custom message which included all the fieldnames but the result is blank.

    Thanks again for a great script.

  33. First of all, wondeful program. Only one problem, I can type jkewbjcrjk@gugee.com as an email address and it goes through as valid email address. How do you stop invalid emails from passing as valid email?

    Thanks, any help is good.

  34. I have the message “Error Sending Message” Everything seems to be ok. Can I check whether I can use my gmail as recipient or must I need to use email created from Cpanel of my domain name that could cause the error.

    regards

    James

  35. 1819
    claudia

    Hello. : )

    First I want to say thank you for this script. It’s the first one – and I tried a lot – that works for me.

    Anyway, I have two questions:

    1. If I include the script in another php-file, can I put the dd-formmailer-css-codes in the css-file that is already linked in the existing php-file? that there is just one css-file at the end?

    2. The auto-reply-message:
    I want to include the “gender” and the “lastname” (in german “Guten Tag, Frau/Herr Schmidt”).
    Is it possible to put something in this $auto_reply_message = ”; that generates that automatically?

    I would be very greatful if you could help me.

    Best regards.

    Claudia

  36. Hello,

    I made a verry long form, can i divide this in more pages by adding a code?

    Regards

    Harald

  37. After I installed and activated this plugin for wordpress it messed with my whole site and now every link I click on is the first blog posting, even though they url changes.
    Has anyone else had this problem?
    Any advice would be appreciated.

  38. 1816
    Bilgin

    Can the send email button be changed to an image?

  39. 1815
    Tony

    Hey,

    If I have a field in the form that contains a group of check boxes and I want to make sure this field is required for the form to be submitted, how do I do this? I can see you can add the ‘required’ parameter to individual check boxes but what about a group?

    Sorry if this has been asked/answered before… spent a long time scrolling through the comments with no luck ;)

    Hopefully someone has a solution…

  40. 1814
    Fred

    test of your capta

  41. 1813
    xx

    dd

  42. 1812
    Rhys

    Everytime there is a new version of the script I update the one I’m using hoping that it will fix a problem that I’ve had for a long time with the script.
    The script works beautifully in IE7 and firefox. Unfortunately the people in the business that I work tend to use internet explorer 6.
    In older versions of internet explorer 6 [e.g. version 6.0.2900.5512] the script will always fail on the first attempt [even if the right code was entered] but then on the 2nd,3rd,4th attempts it always goes through okay. If I close the browser and then open it up again, it fails on the first attempt but will go through again on the 2nd,3rd,4th attempts.
    For some reason the FIRST TIME the script is run in certain versions of IE6 the COOKIE is not getting rewritten which is causing the following error to appear:
    Notice: Undefined index: ddfmcode in E:domains\g\gplocumcover.co.uk\user\htdocs\comments.php on line 1480
    I really would appreciate a workaround for the script to allow it to work the first time in internet explorer 6.I’ve tried all sorts including writing a P3P policy in case IE6 was being picky about the security settings for the site but it still won’t work.
    Thanks

  43. Hi. Great script but I’m struggling with the form layout. Can anyone point me to the right part of the CSS file that I need to adjust to try an make the form elements line up.

    I would be eternally grateful.

  44. 1810
    Sanjeev

    This is in continuation to my previous comment#1809.
    I tried putting the code at top of the calling script but nothing happened and form kept resubmitting upon refresh.

    I also noticed that in dd_formmailer.php there was no line to check value of $_POST['_REPEATED'] and unless this is checked I believe resubmission upon refresh can not be prevented.

    Please help.

    Thanks.

  45. 1809
    Sanjeev

    I am using standalone = FALSE and after submitting where we see the thank you page, on refresh / reload the form sending result(s) which i want to prevent. Please tell me how to prevent emailing on refresh after first form submission.

    Thanks.

  46. 1808
    Ken Bird

    I cannot process the email form. Get the following message – Warning: preg_match() [function.preg-match]: Compilation failed: unmatched parentheses at offset 354 in /home/ricniven/public_html/kenbirddesigns/contactform/form4/contact.php on line 333
    Error!
    • Invalid input in ‘Name’!
    • Invalid input in ‘Email’!
    • Invalid email address: ‘Email’

  47. oh my god! i see that you’ve put a lot of work in this! nice work!
    i will try this and i will come back with the result!

  48. Impressive work here.

    I have inserted sql statements into the script and it now does all I can ask. But I have to ask if anyone else has looked to the best placement of sql statements to utilize the security of dd-formmailer?

  49. I have no idea what it means or how it got there, but I will try to double check everything. Anybody?

  50. 1804
    Ruby Works

    Great Script! But does anyone know how to align the form center or right? How would I do this?
    Thanks!

  51. 1803
    Christian

    Hi!

    I’m trying to figure out this excellent script – but all new to php…
    My goal is, that I would like the script to send to an outside-domain, but to make this possible I apparantly need to include another recipient from inside the domain:

    $recipients = 'to=username@OUTSIDEdomain.com|to=user@insidedomain.com';

    All this I actually working fine – but I would love to have the resulting message not show the “user@insidedomain.com”, but only the “username@OUTSIDEdomain.com in the “To:”-field.

    How can I work my way around this?

  52. 1802
    Sven

    The arabic signs was replaced, let me try again with code-tags:

    
    ??????
    

  53. 1801
    Sven

    After upgrading to version 5.8 i found this arabic letters in the message area (sent from dd-formmailer):

    ??????

    I have no idea what it means or how it got there, but I will try to double check everything. Anybody?

  54. Nice script. I needed to make the background of the verification image transparent, so I changed this part:

    
    $image = imagecreate(60, 24);
    
    list($br, $bg, $bb) = ddfm_hex_to_rgb($verify_background);
    list($rr, $rg, $rb) = ddfm_hex_to_rgb($verify_text);
    
    $background_color = imagecolorallocate($image, $br, $bg, $bb);
    $text_color = imagecolorallocate($image, $rr, $rg, $rb);
    

    to this:

    
    $image = imagecreatetruecolor(60, 24);
    imagealphablending($image, false);
    imagesavealpha($image, true);
    
    if ($verify_background != 'transparent') {
        list($br, $bg, $bb) = ddfm_hex_to_rgb($verify_background);
    }
    list($rr, $rg, $rb) = ddfm_hex_to_rgb($verify_text);
    
    if ($verify_background == 'transparent')
    {
    	$background_colour = imagecolorallocatealpha($image, 0, 0, 0, 127);
    	imagefill($image, 0, 0, $background_colour);
    }
    else {
        $background_color = imagecolorallocate($image, $br, $bg, $bb);
    }
    $text_color = imagecolorallocate($image, $rr, $rg, $rb);
    

    Now you can set $verify_background to ‘transparent’. Be sure to generate the image as a png.

  55. Awesome, awesome script, thanks a ton for providing your code!

  56. You talked about having an option to “prefill” a text block (my planned use was an online petition). I don’t see that documented… is that available in v.5?

    Also, I see the new script asks for the the URL of the file. I’d be interested in knowing why that field is needed; I have been cutting and pasting your forms between a couple of sites, and it seems to me like a superfluous administrative step.

  57. If I could hug you I would…..thanks for the script worked wonders.

  58. Version 5.8 Released

    Changes:
    - Added Estonian language
    - Added code to check for duplicate field names
    - Usage of commas in checkbox descriptions is now fixed
    - Fixed garbled auto-reply messages
    - Adjusted the displaying of uploaded file names in the email message
    - mb_encode_mimeheader error in WP fixed
    - Other adjustments to email headers
    - Added ‘id’ declaration to select boxes
    - Fixed incorrect example code in the instructions
    - Other minor changes

    The WordPress version of the script is fully compatible with WordPress 2.8

    A few people mentioned problems with the date chooser field type. I tested this out thoroughly, and it seems to be functioning fine. Just be sure (if you are using the PHP version of the script) that you are including the required javascript file.

    As always, I am not able to implement every single requested feature, but I try to focus on known issues, while implementing things that many can benefit from.

    Support for 100% compatibility of non-US character sets is still something that is being looked into. If you have a good deal of experience with writing custom email headers to fully support international character sets and would like to help us out please let me know.

    Enjoy!

  59. Having an issue when using this inside another page. The script works, but when viewing in design view, it distorts my whole page and highlights like theres an error.
    When i add this to page, it distorts my design view in dreamweaver. It works fine on live preview, but I dont want to have to remove this code snippet everytime I need to make an update and paste it back in.

    I believe this is due to the DocType in dd-formmailer at bottom of page for standalone. is there any way to mod that second doctype out or remove it without

  60. Charlie Markwick I have to thank you ’cause you solved my problem (comment 1770)!!!

    thanks a lot and thanks of course for this very useful script.

  61. please can any one help me in this regard, I need php mailer.

    i will be glad if some one can help me for i have try all i can to locate any but not that easy for me. send me the phpmailer to.. donalvinmosley @ yahoo.co.uk
    i wait to hear very any one.

    Don Mosley

  62. 1792
    Crawley

    If I could hug you I would…..thanks for the script worked wonders.

  63. Hello
    I like your script very much

    Thanks

  64. 1790
    Tony

    Brilliant script!

    Just a quick question…

    If I have a field in the form that contains a group of check boxes and I want to make sure this field is required for the form to be submitted, how do I do this? I can see you can add the ‘required’ parameter to individual check boxes but what about a group?

    Sorry if this has been asked/answered before… spent a long time scrolling through the comments with no luck ;)

  65. I had a client that was closed on Mon. and Wed. He wanted the popup calendar that schedules his appointments to reflect this. I had to mess with the code for a while before I got it to work, and thought someone else might need similar functionality. Starting at around line 205 of the date_chooser.js I changed this:

    
    if (dayNum == day)
          html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;
        else
          html += TD + TD_onclick + dayNum + xTD;
    

    to this:

    
    if (dayNum == day)
    html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;
        else if (thisDay.getDay() == 0 || thisDay.getDay() == 3)
          html += TD + DIV_noday + dayNum + xDIV + xTD;
        else
          html += TD + TD_onclick + dayNum + xTD;
    

    and added a var in the table variable section starting at line 152:

    
      var DIV_noday = "<div class='dpNoneAvail'>";
      var xDIV = "</div>";
    

    and in the CSS changed added the class dpNoneAvail and set it to display: none;

    There ya go, works like a charm.

  66. Thanks for the great script. I having an issue when using this inside another page. The script works, but when viewing in design view, it distorts my whole page and highlights like theres an error.
    When i add this to page, it distorts my design view in dreamweaver. It works fine on live preview, but I dont want to have to remove this code snippet everytime I need to make an update and paste it back in.

    I believe this is due to the DocType in dd-formmailer at bottom of page for standalone. is there any way to mod that second doctype out or remove it without breaking up the script?

    having multiple doc types in a page can cause all sorts of validation issues. Thanks for any help.

  67. Hello
    I like your script very much but I have a question.
    After I send the message, I have instructed the script to go to the original script page (using standalone).
    The problem is that if a user presses reload, the message will be sent over and over again, even without any input in the message boxes.
    Any way arround this problem?

    Thank you

  68. 1786
    Bryan

    I’m getting extra text inserted in the auto reply email similar to post #1638 or no text at all, depending on the email client being used.

    In outlook, the message appears normal.

    In gmail, the message appears as follows:

    –d543e43bb2c87a3daf858807ea0d640c
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 8bit

    Thanks for contacting us.

    –d543e43bb2c87a3daf858807ea0d640c–

    In yahoo, I’m not seeing any message at all.

    Default options except for auto reply fields.

  69. 1785
    Tdinh

    CORRECTION

    <p class="fieldwrap"><label><span class="required">*</span> Is this a new job or a reprint:</label><span class="fmradio">
    <input type="radio" name="fm_job" id="New Job" value="New Job" checked="checked" /><label for="New Job" class="fmradiolabel">New Job</label>
    <br /><input type="radio" name="fm_job" id=" Reprint with Changes" value=" Reprint with Changes" /><label for=" Reprint with Changes" class="fmradiolabel"> Reprint with Changes</label>
    <br /><input type="radio" name="fm_job" id=" Reprint without Change" value=" Reprint without Change" /><label for=" Reprint without Change" class="fmradiolabel"> Reprint without Change</label>
    
    <br /></span></p>

  70. 1784
    Tdinh

    I have a problem with my radio buttons. The form works and everything; the emails are sent correctly. The only thing is that, when I try to validate the code with W3, there’s an error with the ID elements. The problem with the ID elements are that there are spaces.

    Here is my line of code for the radio buttons:

    type=radio|class=fmradio|label=Is this a new job or a reprint:|fieldname=fm_job|req=true|default=1|data=New Job, Reprint with Changes, Reprint without change

    The code it generates when uploaded is:

    * Is this a new job or a reprint:
    New Job
    Reprint with Changes
    Reprint without Change

    It is obvious that IDs cannot have spaces in them, so is there any way for me to correct this so that I do not have any validation errors in my code?

    It would be greatly appreciated in finding a solution to this problem.

  71. 1783
    Ward

    I am still trying to get the redirect to work and I am also trying to include the “recipient” selection from the dropdown list in the body of the email such as Recipient: John Smith – once I get these to work, all will be well. Any help would be greatly appreciated and thanks again for a very special script.

  72. I use both the php and wordpress versions of your script on several websites – they’re just fantastic! Keep up the good work!

  73. I’m very impressed with the site. Very clean design. I will continue taking a look at your php form script and see how I can implement it into my site.

    Thanks again!

  74. Outstanding script! I got it to work right out of the box. The only problem I have is that I can not get the page to re-direct after it is submitted. Is there a fix for this? I have tried both suggested ways in the help file and have searched the comments.
    Thanks again!

  75. 1779
    bob smith

    Is this script and earlier version php5 compatible?

  76. 1778
    jaymz9mm

    Very nice and works great – although one strange thing I’ve noticed, if I enter “test@test.com” in the email field of the form, the email consistently doesn’t get sent lol

    No error or anything, and it says the message was sent.

  77. 1777
    Maurits

    Hi Admin, thanks for the great work!!
    The only thing I did not succeed in adapting to my needs is the positioning of the fields.
    I’d like them on the left on the screen instead of centered.
    Where do I have to look?

  78. 1776
    leo

    hey…

    Sorry, I posted already on the wrong page…

    I use the “non-WordPress” Version (5.7) of this Script and I still have Problems with the german special Characters in the “Sent” Mails.

    Does anybody have some ideas for me?

    thanks a lot. leo

  79. 1775
    Gary

    i was looking for a mail-script to replace the flawed “Matt’s Formmail”. This one is quite complex. Can it simply be called from a form I’ve already designed on my site, rather than me using it’s custom architecture to create my form?

    thanks.

  80. 1774
    villas

    I need to know how to put another field : “email confirmation” that is to prevent email digitation error (and verify if 2 fields “email” are equal. Sory my bad english. Thanks

  81. Great script and it just keeps getting better over the years. I would suggest for future releases a couple things.

    1) Making uploaded file names unique by appending date()
    2) Including any uploaded file names in the notification mail

    ~ carry on ~

  82. 1772
    mcChris28

    oh snap!…it was because i tried to implement my own submit button image and value, removing DDFM_SUBMITBUTTON… :(

    anybody done this before?…i can’t find this variable lurking anywhere but in the form output area…how/where is the ’send email’ value generated?…

  83. 1771
    mcChris28

    i’m using this script for the first time, as an include, and i’m having an issue with the form submitting the email…

    in ff and chrome my form submits just fine and email is received…

    in ie6 and opera, on submit, there is no $sent_message generated…the page refreshes with a new verification image…no email is sent…

    i’ve yet to test ie7-8 and safari…

    and i don’t see any other comments regarding this issue…perhaps i’ve done something wrong…any thoughts or suggestions?

  84. great script. However as it stands (Version 5.7) the script generated an error for me:

    Use of undefined constant mb_encode_mimeheader - assumed 'mb_encode_mimeheader'

    It is resolved by changing line 595 from:-

    if (function_exists(mb_encode_mimeheader)) {

    to:-

    if (function_exists('mb_encode_mimeheader')) {

  85. Excellent script!

    I am having a curious problem though that I can’t solve. A typical contact form (email, name, message) plus one file-upload input field. Everything works fine on all browsers on both the PC and Mac (IE 6/7/8, Firefox, Opera, Chrome)… all except for Safari 4 Beta and Safari 3 on the Mac. When submitting the form with a file attached, Safari just hangs… until I hit the submit a second time, then it works fine. It is not even that consistent. 20% of the time or so, it does work on the first submit, but the rest of the time requires two submits.

    I’ve been searching the web but can’t figure out if it has anything to do with your script, or, morel likely a Safari, Javascript, jQuery oddity.

    Any thoughts will be much appreciated.

  86. Hi,
    Great script! Worked out of the box with no issues and I’m just a PHP code nugget! Thanks again!
    Cheers,
    James

  87. 1767
    Rob Cook

    Has anybody come up with a way to include the results of a type=selrecip in the body of the email message? I’ve seen the question asked several times, but haven’t seen any answers.

  88. 1766
    dell

    can this script be called from an html file? Im wanting to have the mail form on numerous pages but dont want to have to rename a bunch of them to .php files.

    I hope this can be done as I really like the layout and look of this script, and its ease and functionality.

    Thanks.

  89. 1765
    MowC

    Is there a way to style the button, replacing it with an image?

  90. As Jacob, I also cannot get the asterisk to display for the required fields. They are req, and the form works fine, if req fields aren’t filled in the error message displays. I know the lang file is being read as the submit button, and error messages report correctly. It’s just the asterisk that don’t display.

    I have check my CSS files, the dd-formmailer.css and all other settings and everything checks out. The other forms on my other sites work fine and show the asterisk, and I can’t figure this out.

    Note, of the 4 other forms I use, this is the only one that is the latest version… dunno if that helps.

  91. Hi, is it possible to send the fields from the form as an email attachement?
    Thanks a lot,
    Miro

  92. What is the license of this script?
    Perhaps indicate on the page and script itself.

  93. 1761
    Jo

    How do you format the auto reply?
    –start code–

    $auto_reply_name = ‘Made up Company’;
    $auto_reply_email = ‘info@madeupcompany.org.uk’;
    $auto_reply_subject = ‘Auto Reply’;
    $auto_reply_message = ‘Thank you for contacting Made Up Company, we will endeavour to get back to you at the earliest convenience. Here is a copy of the message you sent for your records. fm_message Many thanks’;

    –endcode–

    As you can see I’ve included the senders message into the auto reply. But I would like to be able to add new lines and rulers.

    –startexample–

    Thank you for contacting Made Up Company, we will endeavour to get back to you at the earliest convenience.
    NEW LINE HERE
    Here is a copy of the message you sent for your records.
    RULER LINE HERE
    fm_message
    RULER LINE HERE
    Many thanks

    –endexample–

    Hope someone can help, cheers.

  94. 1760
    bcoadmin

    Oops, sorry about my last post – the code was not wrapped correctly!

    @Jacob,

    The problem is possibly due to your hosting server or ftp program forcing lowercase filenames.

    In dd-formmailer.php change the following: -

    $language = ‘lang/English.php’;

    to

    $language = ‘lang/english.php’;

    Hope this helps…

  95. 1759
    bcoadmin

    @Jacob,

    The problem is possibly due to your hosting server or ftp program forcing lowercase filenames.

    In dd-formmailer.php change the following: -

    $language = ‘lang/English.php’;

    to

    $language = ‘lang/english.php’;

    Hope this helps…

  96. 1758
    franky

    Ben is right, a forum would be great.

  97. 1757
    Dario

    Can I customize the errors page? I use the code integrated on my website design but when the client misses the code or any require data, the form shows without css format and on a new page, what can I do to preserve my design on missing info errors?

    Thanks.

  98. I suggest we start a forum for this script, there are some good messages here (and replies) but I have trouble locating them easily in this format.

  99. I see several comments asking about the error “No Verification Code Generated” this will appear in browsers with session cookies disabled when verification is set to “basic”

    You can change your verification method to ReCaptcha or change the error message to explain what is happening.

    In lang/English.php I have redefined ‘DDFM_NOVERGEN’ to read
    define('DDFM_NOVERGEN', '<br /><a target="_blank" href="http://www.tubal-reversal.net/cookies.htm"><img src="http://www.tubal-reversal.net/images/icons/enable-cookies.gif" alt="Please allow cookies to use this form." width="222" height="26" border="0" /></a><br />');

    eg. tubal-reversal.net/feedback/index.php

  100. Just wanted to post a tip for all those who want to “secure” their data.txt file.
    Don’t call it data.txt, call it data.php instead. And begin with these lines:

    <?php echo "njet!"; ?>
    <?php return null; ?>

    So even if someone finds out the path to your file, they’ll get nothing.

  101. 1753
    sharp

    :( I don’t know why all russian characters transforms to ‘???’. There is Unicode, isn’t it?

    I downloaded screenshot to imageshack:
    ________img207.imageshack.us/img207/5629/eml.gif

    Ooo, And I forgot one more thing to tell:
    I tried to read messages in Thunderbird, Outlook, Gmail and another 3 web-servers. Everythere the charset in name and subject was incorrect.

  102. 1752
    sharp

    oops… correction:
    ???????? = ‘???? ?????????’
    and in
    596
    $email_subject = mb_encode_mimeheader($email_subject, 'UTF-8', 'Q', '');

  103. 1751
    sharp

    First of all, Dagon Design, thank you for great script! It’s really clear and very adaptable.

    But I have one problem with charset (for non-English characters) in headers (”name” and “subject”) which I can’t solve.
    I use UTF-8, but all messages have “name” and “subject” in another charset (ISO-8859-1 or ISO-8859-5)
    For exapmle of “subject”:
    Тема СообÑ?ения
    instead of
    ???? ?????????" (in Russian)
    And that what I see in code of message:
    =?UTF-8?Q?=C3=90=C2=A2=C3=90=C2=B5=C3=90=C2=BC=C3=90=C2=B0=20?= =?UTF-8?Q?=C3=90=C2=A1=C3=90=C2=BE=C3=90=C2=BE=C3=90=C2=B1=C3=91=C2=89?= =?UTF-8?Q?=C3=90=C2=B5=C3=90=C2=BD=C3=90=C2=B8=C3=91=C2=8F?=

    There is the same situation for another non-en languages (I also tried to use Spanish and Japanese characters in headers) – the same result for “name” and “subject”.

    Everywhere in dd-formmailer.php I have only “UTF-8″:
    596 $auto_reply_headers .= 'Content-Type: text/plain; charset="utf-8"';
    597 $sender_name = mb_encode_mimeheader($sender_name, 'UTF-8', 'Q', '');
    631 $msg .= 'Content-Type: text/plain; charset="utf-8"' . PHP_EOL;
    1891 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    And also utf-8 in auto-reply settings (I don’t use it).
    There is nowhere any another charset set – firstly ISO-8859-x.

    I tried to ad utf-8 in mb_encode_mimeheader, mb_internal_encoding to headers, but it haven’t help me.

    I tried to use script in standalone mode and in another file.
    I use UTF-8 in of site and I tried to add AddDefaultCharset UTF-8 in .htaccess – unfortunally nothing.

    And of course, I tried to find decicion in this comments, but I couldn’t found any of.
    Anybody, please, help me to solve this problem!

  104. 1750
    David

    Form seems to be working, except that *no* error messages appear. I have multiple fields set as required, and am including reCaptcha, but the form submits no matter what is input in any field (or if the fields are left blank).

  105. I’m still Having the same Problem, With the message “DFM_REQUIREDTAG”, I’ve Check The Lang Assignment as far as I can tell its correct, However The one thing about the lang Path it is the only one in the script that asked for the “relative path” Path while the other path ask for the URL. I’m really Desparate Now, I also need it to upload images with its feedback. Will Someone please Help.

  106. Jacob it sounds like you lang files is not being read.

    On our site some users are reporting the error ‘No Verification Code Generated’, is this because of problems with cookies and how can i fix this?

  107. I’m really getting desperated. I’ve been waiting thinking I was going to get an email reply when someone answered my question. Can Someone please tell me what does it mean when it print “DDFM_REQUIREDTAG” above a field? I really want (need) to get this Form Up and running. Please Help.

  108. I uploaded the script. My Problem Is When I call up the script the form Displays On the screen and above each field Printed in Red, “DDFM_REQUIREDTAG” I know its something simple. I’ve read and read but cannot find any writeup about this kind of thing. Help Please.

  109. 1745
    harp

    WORKS: autoreply works, don´t now why! Changed the $sender_name and $sender_email (had the same data in $auto_reply_name and $auto_reply_email)

    Works great now!

    Other question: is it possible to send html in $auto_reply_message. Or at least have line-breaks …

  110. 1744
    harp

    Auto-reply is not functional (Version 5.7). I´m getting the mail for the website-host, but no auto-reply-mail for the sender!

  111. Fasthosts requires that the -f extra parameter is used in order to function properly and send the form data to the requested inbox.

    I found that I had to modify Dagon’s suggested code in the troubleshooting section to get it functioning properly:

    From

    $send_status = mail($send_to, $email_subject, $msg, $headers”, “-f user@domain.com“);

    to

    $send_status = mail($send_to, $email_subject, $msg, $headers, ‘-f user@domain.com‘);

    In other words removing the errant ” and replacing the double quotes with single quotes. Everything appears to be working fine now. Thanks to DD for an excellent script.

  112. 1742
    hatem

    In the registration form write the code needed to prevent the system from signing up a with a number name or a name containing a numbers.

    Add this code to the registration form. Test it and upload the whole file as a text file

  113. 1741
    SKS

    MISSING “javascript pop-up date chooser” !!

    I have been using this great script and is quite happy with it. But today after downloading and put into use, I was quite surprised that even though adding javascript pop-up date chooser is there in the instructions in this very page but all components: calendar.gif, date_chooser.js and css section for this popup calender were removed. After studying the dd-formmailer.php I also noticed that whole section to manage “type=date” was gone missing.

    I wonder was it done by purpose to avoid some security issues or was it a mistake because I did not find any mention here in this matter.

    Any update please?

    Thanks.

  114. Hey All. Best script out there! Anyone know how to use a checkboxes as recipients? Would mean the world to me to make this happen. Thanks Fellow humans!

    Danny

  115. 1739
    dv

    gotta question. my form was working fine. Im now trying to incorporate into a https site. The form works in firefox, but in IE 8, it give me a verification error. Errors!No verification code generated

    It generates a code, but its not recognizing it for some reason. any idea what could be causing this to only happen in IE8?

  116. 1738
    dv

    Jacob, make sure your formmailer path is correct in dd-formmailer.php or whatever you renamed it too.
    $language = ‘dd-formmailer/lang/English.php’;
    around line 44.

    Also make sure you have this in your actual contact page in header.

    Check and see if this helps or points you in right direction.

    Might also want to check the language file as admin suggested a few posts down.

  117. I’ve Set up The Form-mailer. My Problem every field displays “DDFM-Required” In the submit button it’s showing “DDFM_SUBmit BUTTON” What Am I doing Wrong?

  118. 1736
    Bob Alanis

    Dang. Sorry for the multiple posts. I just tried my subject line suggestion and it did not work. My subject line ended up being…

    Subject: Bob Alanis has uploaded to your site

    So it stripped out the file name from the subject line. Any help would be greatly appreciated.

  119. 1735
    Bob Alanis

    Me again. I just realized that I can add the upload field name (fm_upload) to the subject line. So the subject line can be…

    $email_subject = ‘fm_fullname has uploaded fm_upload to your site’;

    It would still be nice to be able to list the files in the body of the email however in case there are multiple uploads (to prevent the subject line from becoming huge).

  120. 1734
    Bob Alanis

    Fantastic script, have been using it for over a year and have been able to always get it do what I want.

    I have a question about the file upload portion. Is it possible to list the file that was uploaded in the email? So the file itself will be saved to the directory, but the email generated will list that file name?

    That way if you get lots of people uploading files, you’ll know who uploaded what.

    Thanks again for this awesome script!

  121. 1733
    Gary

    Hi,
    Great script….just one question. I use a Dreamweaver Captcha extension by (top dreamweaverextensions) I’d really like to use this to protect the form. It normally sits in the form tags but of course things are different here.Do you know If its posible for me to use it somehow?

  122. I’m having a problem with the script generating strange characters when I call it from my contact.php page.

    The characters are  [(an i with umlat) double right brackets and upside down question mark]. The only references I can find to this phenomenon is relating to UTF-8 BOM and the fix was specifically for Joomla. Any help?

  123. dv: Make sure your language file is not corrupt – that constant should be in the file, where you can define it. Worst case, re-upload english.php to /lang/ (or whichever lang file you use)

  124. 1730
    dv

    Im having an issue with this formmail. Instead of showing asterisks for required fields, Im getting DDFM_REQUIRED.

    An OP named Henry had same issue way back, but replied with only I figured it out and didnt state what the fix was. Strange thing is it works just fine on a testing site on another server? Thanks for any help with this.

  125. Version 5.7 Released

    Fixed issues regarding the saving of attached files, data selection values not being recorded, and various minor fixes. Inline styles have been removed from the two field items that contained them.

  126. 1728
    dev

    I think I found out whats causing my page to not look right in design view in dreamweaver, but not sure how to fix it. Its the header and footer at bottom of dd-formmailer.php I have $standalone = FALSE;
    but i think it still calls the head tag. which is why in my include page the is highlighted being an error in code somehow.

    Being I dont want to use standalone, can I simply delete the header / footer ? If so where would I start and end?

  127. 1727
    dev

    Hello and thank you for this great script. I am using dreamweaver to build my site and when I add the to my page my design view in DW goes bonkers. I see the two little php icons, but theres a highlighted in yellow which means an error somewhere. The form still works and look sgood live on site, but i have images next to form and text below form and they are not showing in DW now. They do show up live, but my concern is when I have to make updates to this page I cannot see any images or page info. If I take out the include, everything shows up fine. Theres got to be a simple explanation for this and most likely my own fault, but I cant figure out for the life of me. Thank you for any help.

  128. 1726
    Gregg

    The script has possibilities but it shouldn’t be available for download in it’s current state. To all you people who are pleased with it, have you actually tested all the form elements to see if they work? Well, they don’t and I think this project has been abandoned. The code is overly complicated and that’s not good when a script isn’t working because it makes it hard for anyone to fix. I can tell you though that the “$form_struct” is in a mess. Only certain elements are correct in it. I’m very disappointed to have spent three days integrating a better captcha in the script only to find out that it only partially works. If your going to put up open source code then it should work reasonably well. I don’t think this script is finished and I’m certainly not going to spend my time finishing it. It would be easier to just start from scratch, given the over complexity of the code.

  129. 1725
    Gregg

    I am finding a lot of bugs in the script that I downloaded. The example widtextarea form element always get the error message “character limit for ‘Message’”. The example textarea form element doesn’t get the message so I compared the two validation routines in the script and guess what. There is no validation for the “textare” and the validation for “widetextarea” does work. Furthermore, when viewing the source in the browser, neither one of the form elements contains a value for rows. The select boxes don’t work either. I am begining to think I got a bad download as I see noone else is complaining about such obvious errors.

  130. 1724
    Gregg

    Great script. I have one problem so far. When I copy and paste and of any of the select box examples, the select box displays but it has no items/options in the box.

  131. This script works wonderfully. One question – can I customize the errors page? Can I simply have the form display my own page instructing the user to go back to the form and fix the errors rather than display the awkward text on a white page?

    Thanks.

  132. I use the code integrated on my website design but when the client misses the code or any require data, the form shows without css format and on a new page, what can I do to preserve my design on missing info errors?

  133. 1721
    Asc

    Hello,
    very nice formmailer, thank you!
    I use it as a registration form and my question is if there is a possibility to set some fields for required ONLY if an other one (i.e. radio button) is selected?

  134. 1720
    Keith

    Just answered my own question (1719)
    Put each field on a new line

    $message_structure = 'From: fm_name
    Message: fm_message
    Reply To: fm_email';

  135. 1719
    Keith

    Secure PHP Form Mailer Script
    I also need some help with the syntax for the $message_structure variable. Specifically how to insert new lines same as 1711. Thanks in advance.Excellent Script

  136. Is it possible to allow for multiple auto-replies? My form is a referral form, and I’d like to be able to send one auto reply to the person making the referral AND one auto reply to the person being referred. Currently the auto reply seems to just send to the first email address in the form.

    Any help would be greatly appreciated.

  137. 1717
    420

    If you would like to create an onclick or onfocus event for this script you may do so as such.

    
    //Create an onclick, open new link, function like so:
    type=type|class=class” onclick=”javascript:window.open(\’http://www.yoursite.com\’)|label=
    
    // //Create an onfocus clear function like so:
    type=type|class=class” onfocus=”clearDefault(this)|label=
    

    DONT forget to add the javascript for the onfocus;

    <script type="text/javascript">
    <!--
    function clearDefault(el) {
    if (el.defaultValue==el.value) el.value = ""
    }
    // -->
    </script>

    I hope this helps someone This script ROCKS!

  138. 1716
    420

    Hello I would like to give some advice. If you would like to create an onclick or onfocus event for this script you may do so as such.

    //Create an onclick, open new link, function like so:
    type=type|class=class” onclick=”javascript:window.open(\’http://www.yoursite.com\’)|label=

    // //Create an onfocus clear function like so:
    type=type|class=class” onfocus=”clearDefault(this)|label=

    DONT forget to add the javascript for the onfocus;

    I hope this helps someone This script ROCKS!

  139. 1715
    john

    How can I make a radio button that, when clicked, re directs users to a new page in the same window?

  140. 1714
    Mike

    Hello, I’m having trouble getting the data-saving function to work. I’ve tried storing the file both in wordpress root and plugins folder but no data is storing. Permissions are set to 777.

  141. Can anyone please help me? I would like to create an onclick function for some of my radio buttons. What is the easiest way to accomplish this? Thank you.

  142. 1712
    Pengu

    I’m using latest release as stand alone. I configured it to write to file and not send an email. Everything works, writes to file and displays “thank you” message BUT it also displays form directly below Thank you message. (form doesn’t disapear after hitting send).
    Did anyone else have this problem and/or solution?
    btw – great script, thank you!

  143. 1711
    Steve Nelson

    I’m sorry – this feels like such a dumb question. But I need some help with the syntax for the $message_structure variable. Specifically how to insert new lines. I wish to receive an email with the sender’s name, their phone (a custom field I added) and their message, each separated by new lines. I can’t figure out how to insert any sort of new line character in that variable. Anyone else figured this out?

  144. 1710
    tip

    Very good webpage you have here, and best greetings to all your visitors

  145. Hello again !

    May my text missed some informations for somebody could help me to resolve my problem (excuse me, my english isn’t great : i’m french:)

    Here is the part of my code who create two fields for anybody can choose the recipients of the mail :

    type=text|class=fmtext|label=Email recipient 1|fieldname=fm_email1|max=100|req=true|ver=email
    type=text|class=fmtext|label=Email recipient 2|fieldname=fm_email2|max=100|req=false|ver=email

    And her is the line of the problem :

    $recipients = 'to=fm_email1|to=fm_email2';

    So I would like the content of the two mail fields replace the “fm_email” of $recipients.

    Thanks for your answer !
    Arnaud

  146. Hello All !

    Great job Mister Dagoon !
    I would like to know how to give the possibility, to the users of your secure form mailer, to write the emails of recipients in some text fields (like fm_email1, fm_email2, fm_email3 etc.).

    Is it possible ?

    Thaks for your answer, and congratulation for your job.
    Arnaud

  147. 1707
    Steve Nelson

    Hmmm. Lets try that again.
    Down around line 300 I needed to modify what’s inside the include once parenthesis to read
    ($_SERVER['DOCUMENT_ROOT'].$language);

  148. 1706
    Steve Nelson

    Ah. Okay. My host (DreamHost, PHP 5. something) seems to need this prepended:
    $_SERVER['DOCUMENT_ROOT'].
    So for me, line 300 needs to read
    @include_once($_SERVER['DOCUMENT_ROOT'].$language);
    Now it’s all wonderful!
    Steve

  149. 1705
    Steve Nelson

    Wonderful wonderful resource. But I’m having an odd thing happen with version 5.6, (using it as an include NOT standalone). It works (sends mail) but some of the constants don’t seem to be defined. For example, I have several “required” fields and instead of a red asterisk they are red text reading “DDFM_REQUIREDTAG.” Additionally, the submit button reads “DDFM_SUBMITBUTTON.” And if I deliberately force an error, the error report reads “DDFM_ERRORMSGDDFM_MISSINGFIELD ‘Your Name’ (and so on, each error labeled with the PHP constant, not replaced with meaningful text. Did some constant definitions get lost or did I screw something up? Thanks.

  150. I am very impressed by the number of replies to this post.
    I am number 1697 Amazing.

  151. 1703
    Bill

    Hi – been using this for years on various websites, but I’ve just installed the newer version within an exisiting PHP page and appear to have a large space above the the form.

    I’v tried tweaking some CSS elemnts in the style sheet but can’t get rid of this white space/shift the form up – does anyone have any ideas on how to do this? Cheers ;O)

  152. hi. i have been a longtime user of your script, embedding it in several sites. i see some changes in the newer versions, and have two questions.

    1. i see that the script now takes visitors to a new page as opposed reloading the current page with the confirmation message. i don’t see an option to specify an alternate landing page. having specific landing pages is certainly important — am i missing something?

    2. why do you require a full url including domain name? i often develop sites in folders and subfolders and copy elements between sites. the hard-coded reference is difficult to deal with because it needs revision with every such site change!

    thanks for an excellent and very useful script.

    dan

  153. Script works great – thank you!!

    I’m not brilliant with php – but I’ve used tags in the form labels – and they work great, but they appear in the email submission and I would like to not see them.

    Sorry for such an inane question!!!

  154. Whoops again in 1704. I found that if my sql is outside of the brackets for // Validate input
    foreach ($form_struct as $fs) {
    then a “%0d” will cause an error message but still be inserted into the db. So the sql should be just before the closing bracket of the Validate input struct. About line 1500 something depending on how many lines you have added already to the form struct (it was 1571 for me).

  155. I’ll take post 1704 back. Just tested placement of sql and it works quite securely placed just about anywhere. It either striped any malicious character out of the form or gave DDFM_INVALIDINPUT error for everything I could think of. I’ll get back to you if I can find any security holes in this script.

  156. Impressive work here.

    I have inserted sql statements into the script and it now does all I can ask. But I have to ask if anyone else has looked to the best placement of sql statements to utilize the security of dd-formmailer?

  157. 1697
    Roger

    Got the success message working, (Re msg 1701), I wasn’t using the field name. Works now: >Thank you fm_name- your message has
    been sent.

    Everything works great, Thank you for all of your work.

  158. 1696
    TPL

    Hi very nice work Thank You.
    Little problem I cant find an answer to. When using the javascript date picker I can’t get the dates selected to become required. If set to required and no date is selected it does not show up in the error section when submitted. Any help with this would be very appreciated – Thanks.

  159. 1695
    Roger

    How do I include the sender’s name in the “Success” message? I know you use the field name, but what code do you enclose it in or how do you get it to work so it doesn’t display “field name” as straight text.
    $sent_message = '<br><br><br><center><h1>Thank you - your message has been sent.</h1></center><br><br><center><h3>Return to <a href="../index.html">Home page</a></h3></center>';

    I want it to say Thank you (sender’s name) -

  160. 1694
    Jamie

    I cannot get this to work (I am sure it is my error, being new to this).

    I have emailed the author, but as yet, have not received a reply.

    Is there anyone out there that would be willing to talk me through this or better still be prepared to do this for me?

    Many Thanks.

  161. 1693
    servo

    dangit, missed the two previous comments until after I posted.

    I tried the following, which changed the problem for me.

    By doing this:
    I changed
    line 1300 from
    switch ($fs['type']) {
    case ‘text’:

    to
    switch ($fs['type']) {
    case ‘text’:
    case ‘date’:

    It now validates and adds the date, but now does not validate the rest of the form’s contents… Ideas?

  162. 1692
    servo

    Awesome, awesome script, thanks a ton for providing your code!

    I love the new enhancements but can’t seem to get the date/calendar selection javascript to work properly.

    It displays as intended (ie with the image and drop down div), but when the form’s submitted, the date contents aren’t being added to the email contents. Similarly, the validation doesn’t seem to work either… Probably a related issue.

    Any ideas?

    Thanks again!

  163. 1691
    Tiffany

    I sincerely thank you.

  164. I changed
    line 1300 from
    switch ($fs['type']) {
    case ‘text’:

    to
    switch ($fs['type']) {
    case ‘text’:
    case ‘date’:

    and the date now appear in the email.

  165. I have an issue with date fields they are not being added to the email message?

  166. 1688
    Stephen

    Hey guys, just wondering if anyone is able to help with requests in posts #1687 and #1689 (plus #1597 and #1684)? :)

  167. 1687
    Nefret

    Both new and old version’s verification code does not work!!!!

  168. 1686
    Stephen

    Hello again :)

    Just wondering, in addition to my request in comment #1687, how would I set up the auto reply to come from the email address selected in selrecip?

  169. 1685
    Stephen

    Firstly, just wanted to say what an absolutely wonderful script this is, thank you. Excellent work!

    Secondly, I just wondered how you go about including data from ’selrecip’ into an email or an auto response?

    In your example selrecip code:

    type=selrecip|class=fmselect|label=Recipient|data=(select),User1,user1@domain.com,User2,user2@domain.com

    selrecip doesn’t seem to have a fieldname, so how would we pull in the data from that? Do we add ’selrecip’ instead of fm_fieldname?

  170. For those still asking about SMTP I think this script still uses PHP’s native mail() function. Thus, if your SMTP server requires authentication the script won’t work; at least as far as I can tell. I’d love to see this script using the PHPmailer class from codeworx, but I don’t know how they’d feel about the competition with their own form to email script.

  171. I have been using this script for some time now for a number of client. It has been extremely useful. and I am very appreciative of the hard work that has been ongoing to keep the script up to date. For a new client, I am trying to populate a select field with values from a database. I can get this to work fine, but then the verification image disappears. As soon as I remove the query, all is fine. Has anyone successfully been able to retrieve values out of a mysql database and populate a select field with this script?

  172. 1682
    Mia

    From Patrick #1597 :
    ———
    I have added selrecip as my recipient and added a drop down with the name of the dropdown and the email it goes to, however i want that dropdown to be the subject of the email.
    ————

    Same here. I would like the selected recipient to either be included in the subject line or in the body of the email. How can this be done? Thank you!

  173. 1681
    MikeReills

    HI – great script easy to implement as well. I am trying to make more use of it but I have an issue with passing a value. Essentially I have a holiday site with a number of holiday villas. If someone likes the look of a villa they can click enquire which will take them to the form-mailer. I want though to be able to pass the villaid into the form – is there a way to do this?

    I am no PHP guru so struggling to see how this can be used? any suggestions would be great.

  174. 1680
    Felix

    Problem solved. Forgot to change one old file previous version. Now everything works fine.

  175. 1679
    Felix

    Hi Matt,
    Great improvement, calendar is cool. Going to try that.

    Since updated to newest version 5.6 the asterisk is not showing AND the verification field with its corresponding img is not showing either. I have all other fields working, all paths are ok, $show_required = TRUE; set, type=text|class=fmtext|label=Onderwerp|fieldname=fm_subject|max=100|req=true set and type=verify|class=fmverify|label=Test set. The error file is of course repeating that the verication has to be done before submitting, as without that field showing up you can’t do that and no email can send out. I’m puzzled.

  176. Whenever I am pressing submit I am getting the message “No verification code generated”. I have checked all server settings and it does not work. On one of my sites it works fine and on the other not. Although the configuration is the same. Is anybody facing the same issue?

  177. On my website http://www.targetwebsites.co.uk is a contact form. I’ve tried to incluce a check box into the form (at moment its just text fields).

    I’ve tried the above code to setup a check box but get an error saying “.has_no_newlines prameter incorrect”

    Any ideas?

  178. I want the email subject to be generated from a select field so when the user submits the form whatever the user has selected in the dropdown becomes the email subject.

    Can you help?

  179. Ok, I solved the problem with the date coming from the “javascript pop-up date chooser” not showing in the email sent from the script.

    Go around line 1400 (in my script it’s there, but it depends on how many lines of script you put in the configuration part) in the dd-formmailer.php file and BEFORE this two lines of code:

    case 'textarea':
    case 'widetextarea':

    paste these lines:

    case 'date':
    				
    // type=date|class=|label=|fieldname=|req=(TRUEFALSE)
    
    $t = ddfm_stripslashes($form_input[$fs['fieldname']]);
    
    if ((strtolower($fs['req']) == 'true') && ($t == "")) {
    
    $errors[] = DDFM_MISSINGFIELD . " '" . $fs['label'] . "'";
    
    }
    
    $csv .= str_replace($save_delimiter, ' ', $t) . $save_delimiter;
    $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end;
    $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure);
    $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message);
    $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message);
    
    
    break;

    and everything should work (for me, it works). And if it doesn’t work for you… sorry, I’m a php newbie :-)

  180. Hi I’m using the last version and some older versions of this plugin, but abslout irrelevant which version ..
    I get:
    “No verification code generated” when trying to submit my form.

    Server issues the same as in the pat, but it doesn’t work now.

    the new verfication sends incorrect html and if I’m using this I have the spam protection on every form but I do not need spam protection on every form on the website :(

    I’ve tried every possibilities- nothing:
    “No verification code generated”

    do you or others have a solution?

    thanks a lot

    Monika

  181. 1673
    beyondesign

    This is an amazing product! Thanks so much. However, quick note to end users: DO NOT CAMEL CASE YOUR FIELDNAMES! I spent the better part of 2 hours trying to figure out why some field returns were blank and others populated when all form fields were filled before submitting. Just before calling it quits I dropped the cap(s) and all is now well.

  182. 1672
    Jeff

    FOR ANY ONE WHO MAY HAVE THIS PROBLEM!!!

    Hey – great script! BUT I just stayed up all night trying to figure out why it wouldn’t repopulate the fields on error, and why the asterisks were not showing for required fields.

    Not being a PHP genius, it probably took my longer than it would have taken most of you.

    It seems that the php setup I’m running on doesn’t like the Globals. I haven’t looked, but I’m sure its running as CGI with register globals “off” and whatever other extra security they might have turned on.

    Here’s what you do:
    1. In each output function comment out the line that declares the globals. They look like this:
    global $form_submitted, $form_input, $show_required;

    2. Add those variables to the list of vars required by each function (defined right above the line you just commented out – I’ll use the text one as an example):
    function ddfm_gen_text($item,$form_submitted,$form_input,$show_required) {

    3. Add those variables to ALL the function calls in the loop that creates the form (these are somewhere around line 1820 in my version (again I’ll use the text function call as an example):
    case 'text':$o .= ddfm_gen_text($f_i,$form_submitted,$form_input,$show_required); break;

    There you go. The array with the input will now be fed to the function so it will get output back into the boxes on the form.

    It’s 6:21am here, so I hope this helps SOMEBODY!

    Again, thanks for the script! I can get back to enjoying it!

  183. I would like to know how to make the script return to an html thankyou page instead of just displaying a text line in a blank browser page.

    Thanks.

  184. 1670
    Martin

    @Benjamin

    You can change the width of your input/textarea elements by defining the width in your style sheet (css file).

  185. 1669
    Benjamin

    Oh and I am referring to type=text (not type=textarea).

  186. 1668
    Benjamin

    Andrea – sorry should have worded my question better. I don’t have a problem adding rows to text areas. The problem I have is making specifying a width so that they all the same size. Currently my text boxes and text areas are of different lenghts, I want to be able to add in a value so that they are all the same legnth. Any suggestions?

  187. Benjamin,
    The textarea field type has a special parameter – rows which defines the number of rows in the field (required for valid html).

    Example:

    type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|
    max=1000|rows=6

  188. 1666
    Benjamin

    Does anyone know how to change the sizes of the textboxes and text areas?

    I presume the code to change is here:

    $form_struct = ‘
    type=text|class=fmtext|label=Name:<BR>|fieldname=fm_name|max=100|req=true

    Essenitally one would add “type=value”, however this does not work. I have tried using a value with pixels, all types of bracket configurations, different things than ’size’ such as number_of_chars, etc.. nothing seems to work.

    Anyone got any ideas on how to change this? Am I editing the wrong piece of code?

  189. Need a countries list for you DD form. I created one, available here : http://kevinfilteau.net/2008/11/liste-des-pays-pour-dagon-design-form-mailer-script/

  190. I would like to send HTMl in my auto-reply email. I have seen a few people ask that question but I can not find an answer. Can someone let me know?
    Thanks!
    LB

  191. Great script. Been using it for a while. Thanks!
    My question / problem is about saving attachments to the server. Attachments email just fine, but I cannot get them to save to the server.
    I’ve enabled save_attachments = TRUE and tried setting the save path to everything from /home/mayelala/public_html/carform/upload/ to just /upload/ and nothing seems to work, no errors generated. I’ve set the permissions on the upload subdirectory to everything from 666 to 777, still with no help.
    Any help would be appreciated. Thanks!

  192. Same problem here with dates not passing to email or to data.txt file.
    This is a really great addition if it would work.
    Many thanks for the script everything else works fine.

  193. 1661
    Peter

    Do you know how to have the description displayed on one line and then the input box right below it, instead of side to side?

  194. 1660
    Dell

    Is it possible to mod this form to have entries calculate and show a totals at bottom of list?
    If this requires a custom project can you please email me with estimate. Thank you.

  195. Same problem here: no date passing to the email from the date field

  196. Hello,

    I’m getting a “No verification code generated” when trying to submit my form. I haven’t done anything special here. I have tried specifying “gif” under $force_type, but that hasn’t made a difference. Any suggestions would be appreciated.

    Thanks.

  197. 1657
    Mullie

    The dates are not passing to the email or data file. I also had to change $save_files to $attach_save to get the files locally on the server.

  198. I am using your form with the new date select and it looks great on the form but there are two problems:
    The date field is not validated and can be blank without any error
    The input data is not reported in the email (though every other field on the form is properly included). Seems like a path error, but the page can find date_chooser.js without any problem. Weird. If you have ideas I would love to hear them. Thanks for the new updates. I owe you some money!

  199. My post seems to have been removed. Where can I find specifics on setting up the delimited file posting? I’ve used the search box on this site and used google with the string “delimited site:www.dagondesign.com” which searches the entire site for the term and couldn’t find anything. Please help. Poetry Night in OKC is on the line!!!

  200. 1654
    MelH

    Can we change selrecip to checkboxes instead of a drop down select field? I want the user to check of which recipient to send the message to, choosing 1-n recipients.

    thanks!

  201. 1653
    Mrs B

    Thanks for the script. Got a query regarding the file upload field though.

    If I miss out a required field then when the form is regenerated underneath the error message the values for most of the fields are retained – so they don’t have to be re-entered. This doesn’t seem to happen for the file upload field though.

    Can the file upload field details that the user has entered be retained when the form is re-generated – or is it somehow different in this case? I’ve had a look at the code and the ddfm_gen_file function doesn’t seem to have the same if ($form_submitted){... section that other generation functions have. Is this the key? I’m not familiar with PHP and can’t follow the script details.

    Thanks for any help.

  202. thanks for sharing. I have downloaded it.

  203. Excellent script you’ve constructed. I really don’t know much about php at all. I’m using your script and everything’s working perfectly, except in IE6 for some reason, when I hit the submit button the form just clears the entered results and doesn’t send anything or present a thank you message. Any ideas?

  204. 1650
    Muhammed S.

    Just to say thanks to the programmer of this script!!

  205. 1649
    dell

    If I want to store submitted formmail info into a delimited data.txt file, do I need to create a txt file and upload? How will the incoming data know where to be placed in data.txt? I have my form working fine with this exception. And Im only looking to store certain fields, like name, email, and phone number. Is this possible?

  206. 1648
    anthony

    attachments not coming through. My mail is coming in with information, but the attachments are not. I tried the recommended change below, but it doesnt help any. We also are trying to have the data stored in data.txt file and that doenst save either. Write permissions have been set to 777 for the data.txt file.
    Any ideas or suggestions on what could be the problem?

    if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
    
    To this:
    
    if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\n" : "\n");

  207. 1647
    dellvostro

    not sure why the code didnt show. heres a second attempt. I tried placing code within jw

    // FORM STRUCTURE
    // This is used to generate the form. Each form element must be on its own line.
    // Detailed usage instructions can be found on the web page

    $form_struct = ‘
    type=text|class=fmtext|label=Name|fieldname=fm_name|max=100|req=true
    type=text|class=fmtext|label=Email|fieldname=fm_email|max=100|req=true|ver=email
    type=text|class=fmtext|label=Phone|fieldname=fm_phone|max=100|req=true

    type=select|class=fmselect|label=Quantity|fieldname=fm_quantity|req=true|
    data=(select),100,300,500,1000,2500,5000

    type=select|class=fmselect|label=Product Type|fieldname=fm_producttype|req=true|
    data=(select),Stickers,Decals,Labels,Bumper Stickers,Industry Items,Other

    type=text|class=fmtext|label=Item Number|fieldname=fm_itemnumber|max=100|req=true

    type=select|class=fmselect|label=Use|fieldname=fm_use|req=true|
    data=(select),Indoors,Outdoors

  208. 1646
    dellvostro

    Just checked out this fine script and my only bug thus far is having the drop down working correctly.

    I have the typical name, email and phone fields, then drop down menu. I tried copying and pasting the samples given in your instructions and they dont show up either. I get the drop down arrow, but no options are visible. ???

    Other than that the form looks sweet, nice and clean. What could I be doing wrong here? Ill paste the drop down code thats not working below:

    ??ND?E@?Q??8b?+.??m??z??z?^~???!~??zW?z{f??[z????0?X?{??z???n???{-??-???q??y?.??'??y?Z????k-??-

  209. Hello,

    Thanks very much for the updated script. I installed it and modified it according to your instructions, but I’m still getting the “Could not open socket” error when I try to send myself a test message. I posted more details earlier in comment #1633. The PHP e-mail test script works fine, so it must be some other problem, but I can’t figure it out. I’d really appreciate your help – thank you very much!

  210. Hey Admin!
    Thanks for the update, works like a champ!
    The only issue I am having is if I try to put two forms on one page, I get the error:

    
    Fatal error: Cannot redeclare ddfm_hex_to_rgb() (previously declared in /homepages/20/d201884854/htdocs/sunshinedesign/new/form/email.php:227) in /homepages/20/d201884854/htdocs/sunshinedesign/new/form/estimate.php on line 227
    

    Also, what would it take to make all my configurations in one file so I don’t have to redo them every time a new update comes up?

    Thanks for the awesome form!!

  211. I just uploaded a small update. Apparently some of the code used in the new email validation test required PHP 5. It should now work for those of you using PHP 4. Just re-download and let me know how it works for you.

  212. @1640 – JetJagger:
    I am getting the same issue – please let me know if you manage to figure it out.

  213. Hi,

    Great work on this script, I love it! I do however have one question.

    I am working on a form that has 20 check boxes. Once the form is submitted I would like the selected options to be listed on the thank you page (along with the other fields). Is this possible, without having a full list with TRUE or FALSE next to them?

    What I am looking for is basically what comes in the email, but in the success message. I can use the main fields in it, but I am just struggling with the check boxes.

    As a workaround I got it to echo the email to the success message and hacked around with search and replace to make it fit (sort of!). This is not the ideal way I am sure. Do you have any suggestions?

    Keep up the good work!

    Jim

  214. 1640
    JetJagger

    After an hour of reading and basic customization, I installed the application only to see this:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/hothost/public_html/setup/dd-formmailer/dd-formmailer.php on line 383

    Any solutions?

  215. Version 5.6 has been released!

    This version includes several fixes and new features.

    A javascript date chooser field has been added which displays a nice calendar to select dates (from http://www.nsftools.com/tips/DatePickerTest.htm). Another special field has been added – html – which allows you to easily insert any kind of code into your form.

    Commas can now be used in check boxes, radio buttons, and select boxes. Because commas are used to separate data in these fields, if you want a comma in your text, just use two, and they will be replaced with one before the text is displayed.

    An optional customizable timestamp has been added for those using the ’save to data file’ option.

    A few changes have been made for character support, a bug has been fixed involving spaces in selrecip data, and new (improved) email validation code has been implemented (from http://code.google.com/p/php-email-address-validation/).

    A new language file has also been added: Vietnamese

    WordPress specific updates have also been added for those who also use the plugin version of this script.

  216. Hi. I’d like to thank you for making such a wonderful script and allowing it to be accessed by the general public. It’s very sweet!

    I’m having one problem with this script. When the auto-reply email is sent to Outlook I get extra code before and after the message. It looks like this…

    –2ebbd29ddaa852e5ec9b834bdcaeda6b
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 8bit

    Someone will reply to you shortly.

    –2ebbd29ddaa852e5ec9b834bdcaeda6b–

    I’ve read your trouble shooting page, upgraded from 5.5 to 5.51, and tried just about everything I know how to do.
    Is there a solution to this problem?

    Best regards,
    Chris

  217. Hi, I was wondering if you could provide clues as to how to make one small modification. Is it possible to include the data file that is saved to the server on the email with the other email attachments? So if the user attaches 1 file, the email being sent should include 2 files. The file the user attached and the data.txt file?

    Thanks

  218. Maybe this is a simple question or one that’s been answered before, but I can’t find any reference to it. How do I keep my form populated with the data a user enters after submitting with errors. For example, if a required field is left blank, or if the REcaptcha is incorrect. This is the form I’m working on right now: http://www.nameplatesforindustry.com/dd-inforequest.php

  219. Hi,

    How do I remove this type of extra info appearing in the auto-reply that people are sent when they submit a message?

    –eeecb70ba27992495fc8d1e8bb7c40bc
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 8bit

    I see this before the auto-reply text when I view the auto-reply message.

    Thanks

    Justin

  220. 1634
    alan

    How do you include the Option element and another Input type in the email form?

  221. 1633
    Ryuujin

    Hello,

    Thank you very much for providing such a useful script! I set everything up, but I’m getting a “Could not open socket” error when I try to send a message through the form. I read through your entire article, and one other user (”Geoff”) also mentioned having this error, though I didn’t see any answers to his question. I’m also using Recaptcha (basic doesn’t seem to work on my server because GD can’t be found).

    If it helps, the script is currently in use here:
    http://coconut.milkteahouse.com/dnangel/me.php

    I’ve already tried different e-mail addresses, none of which work, but the test script for PHP mail works fine.

    I’d greatly appreciate your help on this – thanks!

  222. I have items in my forms that have commas (they are prices like $250,000). Is there a way to prevent these commas from creating another item in the list? Basically block the comma separated list from happening in the middle of my prices.

    Thanks

  223. Are you able to have multiple pages of forms so like a Next button that saves all the form data instead of having like 40-50 fields on one page.

  224. 1630
    Jeff

    I currently have phpBB v2 installed and would like a secure form that guests can use to send email to members. Your script looks like the perfect fit – if you can tell me how to pull in a members’ email that is on file in my phpbb database:
    phpbb > phpbb_users > user_email

    Any ideas?
    thanks either way.

  225. Great Script! Moreover I am so happy that you made this script as a wordpress plugin available as well. So I just have to learn the ropes once.

    I got two questions: First, under what license is this script and the plugin?
    Second, could you please extend the above article how to use your script with smtp. I guess most poeple would like to send the form from myfreehostaccountname@freeemailprovider.com.

    Thanks in advance for your feedback.
    Thanks for your effort with this script and the plugin – keep it up!

    Regards
    Jochen

  226. 1628
    lynn

    For those of us with who have hosts that are sensitive to php mail, is there a way to use this with phpmailer? I already have an instance of it on my site for phplist. :)

    MTIA

  227. 1627
    Dave

    How do I keep from sending each message to all recipients, as happens with this coding:

    
    $recipients = 'selrecip to=web@davidgrover.com|to=dc_read@yahoo.com|to=dcr@readwebco.com';
    

    Thanks.

  228. 1626
    mark

    Any easy way to add a date and time stamp to every form entry based on the php time functions? I would like this to be added to the logged data and the prior method suggested in this forum did not work for me.

    Great Script!

  229. 1625
    Mark McCormick

    Do you have any troubleshooting suggestions for logging form submissions? I have $save_to_file = TRUE; and a file wioth proper permissions on the server at $save_path = ‘/log/data.txt’; but I am not getting any logging of data. Any ideas?

  230. 1624
    wai

    Hi , can i know how to change the send mail button to image?
    i change input type = “image” , is work in firefox , but IE cannot work. thank

  231. 1623
    Steve

    @Pete – look inside the ‘lang’ folder for a file called English.php. Open this, either in Dreamweaver or in a text editor.

    Change:
    define('DDFM_SUBMITBUTTON', 'Send Email');
    to
    define('DDFM_SUBMITBUTTON', 'Submit');

    Save it, and upload the changed file to the correct folder.

  232. how do i view the php code in dreamweaver so that i can change the “Send Email” button to read “Submit”?

  233. How do i change the “Send Email” button to read “Submit”?

  234. 1620
    Steve

    @Zoltan (1617) – The script works just great. Perhaps you should get someone else to implement it for you if you lack the skills.

  235. 1619
    lee

    Continuing from my last post (1618).

    this is what I mean…. http://www.rodsdot.com/ee/showOnSelectwithHide.asp

    Is it possible to use this with this contact form?

    Thanks

  236. 1618
    lee

    Is there anyway of having parent item in the ’select’ fields?

    I have a select field with 5 options. I would like our visitors to be able to select one of the options and then another select field would display the model numbers. is this possible?

  237. 1617
    Zoltan

    Sorry, but this script just does not work properly…..
    Total waste of time.

  238. I just came to this site and was amazed to find the valuable info. Keep it up dear. The article is great. Hope to read such good articles regularly.

  239. Version 5.51 has been released

    This update fixes several issues
    - Verification image now displays properly in Safari and Chrome
    - Misc changes to email headers to ensure compatibility
    - Auto-reply issues should all be resolved, including sending auto-reply messages when they are not enabled, and the extra data in auto-reply messages

    Enjoy!

  240. Been using this script for a while now and juts noticed that the image verification (normal one not recapthca) is funky on Safari and Chrome. The images are too small to be readable.

    Anyone have any suggestions for this??? A CSS hack of some sort.

  241. OK…Found the problem, but will post for anyone else that needs the solution. Did not have the full path to the lang folder. Simple but hard if you don’t catch it.

  242. I’m currently using the form on a site with recaptcha. When I switched over to rcaptcha, everything works well except the form output. Instead of an asterisk by required fields, I get “DDFM_REQUIREDTAG Name” and soforth.

  243. 1611
    Steve

    @ajhooven: that solved it… thanks very much. :)

    Looks like the fix hasn’t been applied to the downloadable script yet.

  244. 1610
    ajhooven

    Steve: look at comment 1583. That should stop your blank auto reply message.

  245. 1609
    Steve

    Just to add…

    auto_reply is set like this…

    $auto_reply_name = '';
    $auto_reply_email = '';
    $auto_reply_subject = '';
    $auto_reply_message = '';
    

    and this occurs whether the form is used standalone or as an include.

  246. 1608
    Steve

    Just come across some strange behaviour in this new version…

    I thought it might have been something I’d done, so I’ve re-downloaded the form (5.5) and just tested it “as is” (only changing the recipient and script path). Here’s what happens… when the Sender fills in the form online, the recipient gets the email correctly, but the Sender ALSO gets a blank email (with blank From and ReplyTo fields) even though the script’s auto_reply fields were all left blank.

    Have also just tested it with Version 5.4 and it’s not happening with that. Only 5.5.

    Any idea how I can prevent this strange blank email message being sent to the sender email address?

  247. 1607
    Steve

    Hey – just noticed the new version – you managed to make the labels for radio and checkbox items clickable – FANTASTIC! Thanks!

    Soon as I’m able to, I’ll sort out a donation. Really appreciate you offering this script for free. :)

  248. 1606
    Josh

    When using this script as a plugin with Smarty (PHP templating engine) it fails. It seems to be an issue with its use of global variables. When the script isn’t run in the global scope, it isn’t setting any global variables.

  249. Is anyone able to get the delimiter file working? I have tried giving full rights to the directory both in htaccess, httpd.conf, and standard permission but no luck. It is currently install on wordpress 2.6.2. Here it the path I used /wp-content/data/
    I also tried putting in a file name or just /wp-content/ .
    Still not working. TIA

  250. 1604
    Henry Baker

    Never mind… I figured it out.

    Great script!

  251. 1603
    Henry Baker

    Great script, except for this:

    Instead of the “required” asterisks, I’m getting this:
    DDFM_REQUIRED

    Instead of Submit on that button, I’m getting this:
    DDFM_SUBMITBUTTON

    And instead of a normal credit line this:
    DDFM_CREDITS Dagon Design

    The paths are all correct and I can find no way to make those appear as they should.

    I’m testing the script as a standalone with nothing changed except what was minimally necessary.

  252. Great script many thanks for your hard work.

    I too was having extra lines appear with auto reply.

    4 lines of numbers like this:
    –49a176076db5bd75e0867d8931277543–
    Implemented ajhooven’s fix in post 1591 now all fixed.
    Many thanks.

  253. 1601
    Mark

    And it’s me again. It just happens in Safari, when you turn verification off. Someone else mentioned that in a comment in 2007.

  254. 1600
    Mark

    Hi it’s me again from “1599″,

    This happens when i turn verification off. The form is sent automatically and the “Thank you…”-Message appears. Is it possible to turn verification off and display a form ?

    Thanx for Info
    Mark

  255. 1599
    Mark

    Hi all,

    I deactivated the standalone function and included the script as statet with inlcude but it always shows me the “Thank you – your message has been sent.” and no form is loaded ? Does anyone have information on how to fix this ?

    Thanx, Mark

  256. 1598
    Dell

    Im getting a notice error when using 4.2 formmailer. Ive used this formmail on numerous servers for testing with no problem, and when I upload to one clients site, I get the following error.

    Notice: A session had already been started – ignoring session_start() in /var/www/vhosts/mysomain/httpdocs/formmailer.php on line 1

    When testing on numerous other servers, it works just fine. Any ideas on what this could be and how to fix, hide or suppress the notice?

    I know its an older version, but it works fine and I would really not want to create this long form over again if its at all possible.

  257. 1597
    Patrick

    I have added selrecip as my recipient and added a drop down with the name of the dropdown and the email it goes to, however i want that dropdown to be the subject of the email. example in the dropdown i have lost password and it goes to a seperate email but when i test there is no text in my email saying it is for lost password. How do i do this?

  258. 1596
    ajhooven

    Glad i could help. :)
    I dont normally comment on free scripts when i find bugs in them but because this one is so well written and easy to follow, i thought i would give something back.

  259. 1595
    mojowrkn

    ajhooven – That worked! Both problems fixed. Thanks very much for your help.

  260. 1594
    Spencer

    Love the new form, especially with the manual code. I’m having a bit of a brainfart though, and I can’t seem to figure out one thing having to do with the background color.

    In Firefox, it works perfectly. In IE7, whenever I either submit an email, or when I get an error message, it changes the background color to white, instead of brown (what I want it to be set to.) I’ve set the background of my custom code to brown, and it shows correctly, but still the error messages or the “Your email has been sent” messages will change the background to white again!

    Like I said, brainfart. :) This is probably something easy, but any comments would be great.

  261. I’m having a problem locating in the css where to change the font color for the success message, or the “$sent_message = ‘Thank you – your message has been sent.’;” area.

    Could somebody please help? You could just fill out the contact form on my site: http://www.jeffsaffle.com/contact and it would get to me.

    The form is working, I’m just having a itty bitty problem with the font color.

    Thank you!

  262. 1592
    Cuauhtemoc

    Hi. First for all, thank you for this wonderful script. It’s been very helpful.
    Now a question, is there any way to change the encoding from UTF-8?
    Thank you.

  263. 1591
    ajhooven

    I think i have the extra code in the auto replys sorted, it seems to be working for me… i dont know if it is the right way to do it… but try:
    commenting out line 1547
    $auto_reply_headers .= 'Content-Type: text/plain; charset="utf-8"';
    and move line 1141
    $auto_reply_message .= PHP_EOL . PHP_EOL . '--' . $mime_boundary . '--' . PHP_EOL . PHP_EOL;
    to below line 1547

  264. 1590
    ajhooven

    ok… I just tested the auto reply using a hotmail address and am getting the extra code in the auto reply email when viewing through the hotmail web page. Up until now i have been testing using Thunderbird…. where i dont get the extra code.

  265. 1589
    ajhooven

    mojo: I had to remove the comma between ‘fm_lastname, fm_firstname’ to get the name fields to work. The extra semi-colon doesn’t need to be there but it doesnt hurt. I dont know if removing the comma will fix your extra lines problem though…..

  266. 1588
    mojowrkn

    I am getting the same extra code on the Auto Reply emails that OZ reported in posts 1577 & 1578. But I am trying to use the auto reply, so commenting out the section won’t work.

    Also, I downloaded the newest version (dated 8/30/08 6:05 PM) so my code looks a little different than in the posts from ajhooven. It looks like there may be an extra semi-colon on the end of the line $auto_reply_headers .= 'Return-Path: ' . $auto_reply_name . ' <' . $auto_reply_email . '>' . PHP_EOL;; Removing one semicolon didn’t seem to help though. Any suggestions?

    Also, I am trying to use the two fields to populate the “from” on the email(Line 118). $sender_name = 'fm_lastname, fm_firstname'; as suggested in the instructions. The problem is it will only populate the last name. I can change it to one or the other (fm_lastname OR fm_firstname) and either one will work, but not both.

    Thanks – this is a great form/script. Keep up the great work!

  267. First of all thanks for all your hard work on a great script! I have it working flawlessly but do have one issue.

    I want to provide a default value in the message body field, but I can’t seem to add line breaks for paragraphs.

    Any ideas?

    Thanks again.

  268. 1586
    sylunt1

    Greetings:

    I posted a long time ago about the SMTP portion of the script (non wordpress).

    ini_set(”SMTP”,”mail.MYDOMAIN.com”);
    ini_set(”smtp_port”,”587″);
    ini_set(”username”,”MYUSERNAME@MYDOMAIN.com”);
    ini_set(”password”,”MYPASSWORD”);
    ini_set(’sendmail_from’, $sender_email);
    $send_status = mail($send_to, $email_subject, $msg, $headers);

    ini_restore(’sendmail_from’);(Just search for the reference to the mail() function to see where to add it)

    Where does this go (line #) and am I just adding the lines in there or replacing something or what?
    Thanks,
    Chris

  269. 1585
    ajhooven

    Trator: The autoreplys are working fine for me now that i changed the two lines i mentioned in these comments : 1583 and 1574.
    Sorry i dont have any other ideas….. maybe a server related issue?

  270. I am getting the same problem in my auto replies but your fix did not work for me. Any other ideas?

  271. 1583
    ajhooven

    With regard to OZ’s problem, i found that if you change line 1534 from:

    
    if (($auto_reply_message != "") && (trim($sender_email != ""))) {
    

    To:
    
    if (($orig_auto_reply_message != "") && (trim($sender_email != ""))) {
    

    The script will work as i believe it was intended ie. “To disable, just leave $auto_reply_message blank.” on line 149

  272. 1582
    Leonid Yurkovsky

    5.5 version (and previous) dont work in browsers IE, Opera, Chrome.
    Error: “No verification code generated”

    With a Firefox browser there are no problems

  273. This may have been asked already, but everything is working with the email except the attachments. Nothing comes through and it doesn’t seem to be saving them to the server if I try that as well. Any thoughts?

  274. 1580
    Josh

    Thanks for the great script.

    I have 2 questions i’m hoping you can clear up for me.

    Is there a way to use a check box that when check either copies the info from one field into another or removes the required option from the second field? So users don’t need to fill in the same info twice.

    also, i’ve noticed when i have a radio button set as required there is no asterisk added like with text fields, am i missing something or is this just the way it is?

  275. 1579
    OZ

    No need to answer my previous query, found a solution.

    In case someone encounters the same issue, comment out or delete the autoreply section that begins around 1533 to 1554. This is just after where you would insert code to have the script jump to an html link versus showing the success message after form submission.

  276. 1578
    OZ

    I see the email output didn’t post. Trying again…

    
    --1ca29ba04130d8964254b69aadba0149
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: 8bit
    
    --1ca29ba04130d8964254b69aadba0149--
    

  277. 1577
    OZ

    Wonderful form. Thanks.

    Encountering one problem.
    When completing a form, the sender receives an undesired auto-reply like email with several lines featuring the same peculiar string of numbers and letters. (This string varies per email).

    I’ve tried to take numerous steps to disable the auto-reply, but to no avail. I can change the headers, subject insert message, etc. through the custom auto-reply options, but can’t get rid of the rest or stop this apparent auto-reply from being sent. Appreciate any help.

    Below is an example of an email the sender receives.

    <>

    ….(Three more identical strings always appear before the email ends)

  278. ajhooven: Thanks :) I fixed it and re-uploaded the script.

  279. 1575
    ajhooven

    Sorry it is actually line 1540 in my previous comment.

  280. 1574
    ajhooven

    Hi,
    I just downloaded your script and am working through it (it looks great!). One thing i discovered is that the autoreply wasn’t working.

    I found by replacing (around line 1586):
    $auto_reply_headers .= 'Return-Path: ' . $auto_reply_name . ' <' . $auto_reply_email . '>';
    with:
    $auto_reply_headers .= 'Return-Path: ' . $auto_reply_name . ' <' . $auto_reply_email . '>'. PHP_EOL;
    fixed the problem.
    I hope this helps anyone having the same problem

  281. Hi,
    thanks a lot for you script.
    Just one thing, the code that you use to check the email address are now updated form the author. You can find a post: “Email Address Validation Updated” (July 15, 2008) in the same site (www.ilovejackdaniels.com) that now is: http://www.addedbytes.com. The post is in: http://www.addedbytes.com/blog/email-address-validation-v2/. Bye.

  282. 1572
    Brian

    I love this script. I want my little form mailer to reside on multiple pages though, like 10 or so. Does this mean I have to make 10 different ddformmailer php files?

  283. 1571
    Phil Waddle

    Hi and thanks very much for all your effort and generousity in providing this free script.

    I have spent most of the day trying to work out why a fieldset beneath select fields would not render other than corruptly in IE7 yet was fine in FF2/3.

    I offer the solution to your css if it any use to you. After trying many areas of the css I narrowed it down to something in the class ‘form.ddfm select.fmselect’ as when this class was commented out the fieldset was fine.
    Removal of the float; left style in fmselect made the fieldset box and it two fields appear correctly.

    Whether the problem only occurred because the fieldset appeared after the select fields I do not know but the fix worked to stop this happenning.

    Once again thank you for the script and I hope my efforts may help.

    Regards
    Phil
    I

  284. Version 5.5 Released

    This is a very big update. Changes include:

    - Tested and works in WordPress 2.6+
    - Fixed various undefined index errors
    - Many code changes to improve xhtml validity
    - Attachments can now be saved to the server (not just emailed)
    - Much improved email header handling for language support
    - Can auto-attach url of form to message
    - Fixed issues with required fields in select boxes
    - Added Belarussian, Czech, and Japanese language files
    - Labels for checkbox and radio items are now clickable
    - Various other code fixes

    I wanted to mention something that a lot of people have asked about – using the manual form code option.

    Many of you have said that the user’s data is not saved if they have an error in their input when using this method.

    This is not a bug, it is just the way the script works. I added the following information to the page:

    Important Notice: Because this method means you will be writing the form code yourself, and it will not be generated by the script, there is no way for it to automatically insert the PHP code needed to put the user’s input back into the form when there is a validation error. It is just not possible for this to be done automatically due to the nature of the option. The only way this can be accomplished is if you know enough about PHP to insert the code manually yourself. In other words, this is a very advanced option – only for those who are very familiar with HTML forms and PHP.

    If any little issues spring up just let me know. Enjoy!

  285. 1569
    Jeff

    This script works wonderfully. One question – can I customize the errors page? Can I simply have the form display my own page instructing the user to go back to the form and fix the errors rather than display the awkward text on a white page?

    Thanks.

  286. 1568
    Patrick

    Please ignore my last message – wrong script!

  287. 1567
    Patrick

    I posted a message here on 12th August about problems I was having with the script.

    I checked back daily to see if there was any response but found none. Furthermore, over the last weekend, the site has been unavailable.

    Checking back this morning I find that my message is no longer here. Has it been removed because you don’t want to answer or was there some technical problem?

  288. 1566
    ElQanah

    Rudolf, all I did for special spanish characters to work for me was changing this piece:

    $msg .= ‘Content-Type: text/plain; charset=”iso-8859-1″‘ . PHP_EOL;

    for this one:

    $msg .= ‘Content-Type: text/plain; charset=”utf-8″‘ . PHP_EOL;

  289. 1565
    mike

    hello,

    I am trying to use the following code but seems not to do what it is supposed to do.
    anybody to help me out?
    I just want to receive a copy of each mail sent to different users using SELRECIP.
    thank you for your precious help.

    //***********//

    “Using SELRECIP and BCC together
    The easiest way to do this, is to find the following line in the script:

    $send_status = mail($send_to, $email_subject, $msg, $headers);

    If you are using SELRECIP, the message will be sent to whoever the visitor chooses. If you would also like the message to go to someone else, no matter who is chosen, just duplicate that line like so, adding in the address of the secondary recipient:

    $send_status = mail(”user2@domain.com”, $email_subject, $msg, $headers);”

  290. Looks like my question got squeezed out by a longer conversation….

    Here i try again..

    I changed the Header “From:” to utf-8 in the script to make sure the name of the input submitter comes also through in any foreign language.
    It works, but i also somehow get the Verification code added in front of the Name in the From header, how come, what’s wrong with the way i wrote it??
    $mail_header .= “From: =?utf-8?b?”.base64_encode($name . strip_colons($t)).”?=” . $mail_name . ” “;

  291. 1563
    Martin

    Hi jacka,

    You don’t need “echo”.
    I’m not sure if I fully understand your project, but this should do the trick:
    value="' . $row['price'] . '"

  292. Why won’t this work?
    * Total ‘.echo “200″.’

  293. Hi martin
    maybe I have not explained myself well.
    What I am trying to do is to use your form, possibly in stand alone form, to present user to input some data.

    So far so good.
    Also I want to display a couple of data from a database. So for example I would like to show the total purchase is £xyz.
    Now some how, either in manual or otherwise, I would like to insert a php code that fetches a value from a database and inserts it as a value to this field. so when the user submits the form, he/she gets all the data plus the total cost in their email.

    you were very helpful in sorting out in sending a copy of message to the user and this is the only thing that is stopping in finishing the project.

    I can’t understand your . $_POST['fm_name'] . statement as I am not getting any values from any previous form.
    I have tried .echo”$row['price'] for example that would fetch a value from database and place it there, or am i being extra stupid.

    Obviously every one wold like the data to be preserved in case the user makes a mistake.

    Cheers

  294. 1560
    Martin

    @jacka

    If you want to use manual form code and preserve the user input, you have to insert some php.

    Replace
    * Total Cost <input class="fmtext" type="text" name="fm_name" id="fm_name" value="" />

    with
    * Total Cost <input class="fmtext" type="text" name="fm_name" id="fm_name" value="' . $_POST['fm_name'] . '" />

    You have to do this for all input elements and for the message field in a similar way (Change fm_name to fm_email, fm_subject, fm_message and so on…).

  295. Hi martin
    Thanks for your quick reply.
    I twice entered the php code in between the values but every time it got deleted after submission.
    I would be grateful if you would just insert a php value in between the quotes for me to show how it is done, as I have exhausted all the possible variations.
    Thx

  296. 1558
    Martin

    @jacka

    * Total Cost <input class="fmtext" type="text" name="fm_name" id="fm_name" value="" />
    This is HTML. I don’t see any php code in your example.

    To answer your question: Yes, it is possible to insert php code into $manual_form_code.
    You have to make sure, that your php code is delimited by points and single quotes:
    ' . some php code . '


    By the way: I wouldn’t recommend to use $manual_form_code, because this variable “forgets” the user input. If somebody fills in the fields of your formmailer and makes a mistake, he has to fill in all fields again.

  297. Sorry that didn’t show:
    * Total Cost <input class=”fmtext” type=”text” name=”fm_name” id=”fm_name” value=”" />

  298. @martin
    I include a simple example of what I am trying to do with php code:

    $manual_form_code = ‘

    * Total Cost <input class=”fmtext” type=”text” name=”fm_name” id=”fm_name” value=”" />

    Script by Dagon Design

    ‘;

    I have tried a few variations of the php code but none seem to show the value.
    Please helpppppp

  299. Hi Martin

    Correction, the $recepient variation works fine. many thanks for that.

    Can you please read the question no:1648 regrading inserting php code in the $form_struct=” since I am not able to put any code in it.
    With thx.
    jacka

  300. @ martin

    Ho martin thx for getting back to me.
    I am very confused regarding visitor getting a copy of the email.
    I have tried your $recipients = ‘to=jacka@example.com|bcc=’ . trim($_POST['fm_email']) . ”; code but it doesn’t work.
    Can you please check that there is no errors in it.
    Also can you please tell me what if any information i need to put in the auto reply section.

    Thanks for your time

  301. 1553
    Bill

    I am Building a Web Site Iam useing the Form Mailer , problem I am having is I cannot seem to get it to line up to see this please Visit http://www.highvoltage1200.net/contact.php I’m not sure How to rectify this problem the message box & the Verify code Box seem to be clashing I’m new to all this and would really appreciate any help or Advice you can give me Thank You .

    BTW it is a Great Script :)

  302. Slight correction, the code line in question in full is:
    $mail_header .= “From: =?utf-8?b?”.base64_encode($name . strip_colons($t)).”?=” . $mail_name . ” “;

    What’s wrong with it???

  303. New little Problem:
    In my older version contact form i have tried this:
    $mail_header .= “Content-Type: text/plain;\r\n charset=\”utf-8\”\r\n”; /* mn; declare the body to be UTF-8… */
    $mail_header .= “From: =?utf-8?b?”.base64_encode($name . strip_colons($t)).”?=” . $mail_name . ” “;

    along with this:
    $mail_subject = “=?utf-8?b?”.base64_encode($subject . strip_colons($t)).”?=”; /* mn; Send the Subject as UTF-8 */

    It ensures that not only the body but also subject line and name of sender are transported in UTF-8 and therefore in any language.

    However, the part:
    $mail_header .= “From: =?utf-8?b?”.base64_encode($name . strip_colons($t)).”?=” . $mail_name . ” “;
    is somehow not done right!
    It does return Chinese Names to the From field in an email, but for whatever reason it also adds the random verification code in front of the name……..

    No clue how that happens, but someone might have an idea and knows how to get it right???

    Thanks,
    Rudolf

  304. sorry that should read
    if i remove the generated division i will be able to insert my own.

  305. i am looking at stuff like
    if ($form_submitted) $value = ($form_input[$item['fieldname']])

    but this is beyond me, i am going to go back to my initial issue formatting and instead of manual form code i might attack the ddfm_gen_fullblock if i remove the generated i will be able to insert my own.

  306. We have used Secure PHP Form Mailer Script for a couple of years now and have found it excellent.

    I am upgrading to v5.4 and this is the first time that I have tried manual form code, I like the idea of the freedom it will give me in formatting but first need to solve the issue with retaining input upon errors.

    I see a few comments about this but no solution yet, has anyone the answer?

  307. 1547
    Martin

    Good to hear that you eventually found a solution, Rudolf.

  308. Thanks Martin.

    My web hoster actually found out how to correct the verification generation code sniplet so it displays numbers only:

    function generate_verification() {
    srand((double)microtime()*1000000);
    $rand = rand(0,999999999);
    $thecode = substr(strtoupper(md5($rand)), 2, 5);
    $thecode = str_replace(”O”, “A”, $thecode);
    $thecode = str_replace(”0″, “B”, $thecode);
    $thecode = strtr($thecode,”ABCDEF”,”123456″); /* mn; only display numbers, no chars… */
    $_SESSION["thecode"] = $thecode;
    }

    P.S. you question from a previous comment about “who is Aleister”……
    That name is at the top of the secure PHP script where it says
    Secure PHP Form Mailer Script v4.0
    Created by Aleister
    ……………………………..
    I have been using this script (and older versions of it too) since years now and i could swear in the beginning someone by this name answered questions in this comments style thing…….

  309. 1545
    Martin

    @Rudolf

    The problem is that your script works totally different from the versions I know.
    Without seeing the whole script I can only guess what has to be changed inside your script.

    Maybe it’s better to get in contact with the script author (or you update your script to the latest version).

    You asked if using numbers instead of numbers AND letters is a security risk.
    From a mathematical point of view it is of course easier to guess a single digit (there are only 10 possibilities) than guessing a letter OR a digit.
    That means that guessing a 5-digit number is easier than guessing 5 characters consisting of numbers OR letters OR both.

    This question is important if you create a password, but it’s not so important for the formmailer (because it is not very likely that somebody attacks your script with a brute force attack).

    I think it’s no problem if you want to use only numbers in your script.

  310. Hmmm Martin,
    my comment on your comment did not appear in this comments, wonder why – so i try this once more.

    The code sniplet
    function generate_verification() {
    srand((double)microtime()*1000000);
    $rand = rand(0,999999999);
    $thecode = substr($rand, 2, 5);
    $_SESSION["thecode"] = md5($thecode);
    }
    did not do the trick, it returned still numbers AND letters, in fact simply one digit more then before… what is the error??
    Is using this script with only numbers a greater security risk then if it had letters and numbers???

  311. 1543
    Martin

    @jacka

    I was wrong yesterday.

    You can send an exact copy if you are using the variable $recipients.

    Simply change it from something like
    $recipients = 'jacka@example.com';

    to
    $recipients = 'to=jacka@example.com|bcc=' . trim($_POST['fm_email']) . '';

    (I don’t think that this snippet could be a security issue, because the control mechanisms of the script – e.g. the character injection test – are triggered before any e-mail will be sent out.)

    ——
    (Short note on the the auto reply function:
    When I tested the auto reply function, the result was as follows:

    Using field names worked for the message body and the recipient, but not for the subject and the from field. That means that you can send a copy of the message body, but not an exact copy of the whole e-mail (like a carbon copy or a blind carbon copy) with the same subject and the same from field.)
    ——

  312. Hi

    I have copied the code from view source and pasted into the manual $manual_form_code.
    This displays fine.
    However, how can I now put php code in there?
    And if I do, it does not show in the output.
    I just put a simple

    $manual_form_code = ”; and it doesn’t show anything.
    What am i doing wrong? How can I put php code in the manual_form_code ?
    Thx
    How can I insert php code

  313. @martin
    Thanks for your reply.
    Just making sure we are talking about the same point.
    I would like the visitor to get an exact copy of the email that I get using the email address that he/she has inputted in the form.

    Also I see that in the description of the ‘Auto reply function’ it says:
    You can also use field names in the auto reply message, and the user input from those fields will be used to generate the message.

    can I therefore use the email input from the user to email it back to them?

    I hope at least I have cleared my point.

    If this can be done then we can think about how to do it.

    Thx

  314. 1540
    Martin

    @jacka
    Hm, I would say: try the auto reply function. But it seems that this function doesn’t work as expected.

    I think it is not possible to send an exact copy to an “undefined” e-mail-address without screwing up the script.
    (But maybe there is a solution and I don’t see it)

  315. Hi Thanks for your reply.
    I have written a couple of php scripts but I am still a beginner.
    Also could you please tell me if the user can have an exact copy of what I will be getting through email. If yes, how?
    Thanks

  316. 1538
    Martin

    @jacka

    Do you have some php knowledge?
    You could do it with
    strpos

    Description of strpos:
    http://php.net/manual/en/function.strpos.php

  317. 1537
    Martin

    @Rudolf
    I don’t know who Aleister is (the script author?), but I am Martin (a simple user). ;-)

    Looks right what you changed.

    But it seems that your version of dd-formmailer differs from newer versions (usage of sessions vs usage of cookies).

    So we have to change a little bit more than what I’ve posted before.

    Replace
    $_SESSION["thecode"] = $thecode;
    with
    $_SESSION["thecode"] = md5($thecode);

    and try it again.

    The complete snippet would look like this:

    function generate_verification() {
    srand((double)microtime()*1000000);
    $rand = rand(0,999999999);
    $thecode = substr($rand, 2, 5);
    $_SESSION["thecode"] = md5($thecode);
    }

    I hope it works.

    Good luck

  318. Any reply for me yet?
    it would be much appreciated.
    thx

  319. I use an older version of your script Aleister.
    It has this code in it:
    function generate_verification() {
    srand((double)microtime()*1000000);
    $rand = rand(0,999999999);
    $thecode = substr(strtoupper(md5($rand)), 2, 5);
    $thecode = str_replace(”O”, “A”, $thecode);
    $thecode = str_replace(”0″, “B”, $thecode);
    $_SESSION["thecode"] = $thecode;
    }
    according your suggestion for your latest version i tried to change it like this:
    function generate_verification() {
    srand((double)microtime()*1000000);
    $rand = rand(0,999999999);
    $thecode = substr($rand, 2, 5);
    $_SESSION["thecode"] = $thecode;
    }
    But this just gave me all questionmarks for the form field description texts, i guess i am not good enough to know exactly who to change it right to get just numbers, can you correct me with the right code??

    Thanks,
    Rudolf
    P.S. my form at proftech.cn uses
    <form accept-charset=”utf-8″ method=”post”
    so Chinese text can be transported as well as any other language – in theory.
    It works somewhat with Yahoo or other online email services but not with my hosting companies email client.
    They told me it needs some more code regarding correct functioning.
    —————Full headers copy and paste——————
    Subject:
    Pudong Workshop: test
    Content-Type:
    text/plain
    ——–end full header test email——————
    it shows that Subject line is not transported in UTF-8 and Body shows correct Chinese text in Yahoo etc. but it is actually missing the UTF-8 encoding info in the Content-Type and therefore i guess the hosts email service can’t read it as Chinese, do you know who to fix this issues perhaps as well?

  320. 1534
    Martin

    @Rudolf

    1.) Search for
    $ddfmcode = substr(strtoupper(md5(rand(0, 999999999))), 2, 5);
    in your dd-formmailer.php and replace it with
    $ddfmcode = substr(rand(0, 999999999), 2, 5);

    2.) Delete or comment the following two lines:

    $ddfmcode = str_replace("O", "A", $ddfmcode);
    $ddfmcode = str_replace("0", "B", $ddfmcode);

  321. Hi
    i have one more question, please.
    I have introduced a field called postcode to the form.
    How can i check it if it starts with GY (for guernsey, lets say). So I can make the vat exempted.
    Thanks.
    By the way a very functional and simple script.

  322. Hi
    Can you please tell me if it is possible for the visitor to get a copy of the form in the email form. (The same as what I get, in the $recipient).

  323. 1531
    MikeM

    Thanks for the script :-)

    I’ve getting “undefined index” errors when a form is submitted with any checkboxes unchecked.

    I notice in the release notes that in two previous version “undefined index” issues were resolved, but I’ve got 5.41.

    Is the problem back, or have I done something wrong?

    The checkbox code I’m using to generate the error is from your second example in the documentation above, btw. (Yes, I joined the two lines that are wrapped in the example :-)

  324. I forgot to mention something else…

    I initially had problems because the script would report that my required fields were not being filled, even when the user did input data to them.

    I figured out that the problem was because i had used some capital letters in my field names. When i made my field names all lowercase, everything worked perfectly.

    I don’t know if lowercase fieldnames are required by design, or if that’s a bug, but it either needs to be fixed or it needs to be documented. (At least, i didn’t see anywhere that this was documented, and i did read all the documentation pretty thoroughly)

    Many thanks, though, because the script does a great job!

  325. I would like to recommend the following method for “redirecting” the output of the form after submission (for both dealing with errors and to show the thank you message).

    I created a page called “reservations-thankyou.php” which contains the php call to dd-formmailer.php and some html text with info related to once the user has filled out the form (in my case, made a reservation).

    In the configuration section of dd-formmailer.php, i set the $path_contact_page option to be the “reservations-thankyou.php” page, so that is the page that it displays after processing the form.

    However, I wanted to have the user fill out the form on a different page, “reservations.php”, where there were different options for making a reservation. So in hte “reservations.php” page i included the same php call to “dd-formmailer.php”, so it displayed the form to be filled out there, but when the user submitted the form, the script processes it and displays the reservations-thankyou.php page.

    Everything seems to be working perfectly with this method. Maybe it will help someone else who’s interested in doing hte same setup.

    Many thanks for creating this awesome script!

  326. 1528
    Neetu

    Very nice job! keep it up! I do need php script of server side for making session, cookies and other valueable security feature and rare scripts. Plz email to me for scripts

  327. 1527
    Carl

    Hi,
    Is there a way to get this form to send to custom error and thank you pages? and if so, how do I go about it? for example, do I add hidden fields to my html? and where would I add the url’s within the php script?

    As someone who is new to php, I have searched and tried many formails and this is the best I have come across, though not as straight forward to set up.
    I like the fact that it does not show or link to the email address within the script and all the other security benefits. I also like the fact that any number of fields can be added wether that be text box, check box etc and required fields can be added.

    Good stuff, keep up the good work.
    Many Thanks

  328. 1526
    Mike

    I still remain unable to get the advanced SMTP features to work properly. I was under the impression that the default php mail() function doesn’t play nice the SMTP that requires Authentication (username and password only, not SSL)? Am I wrong in that? Or should those ini_set variables be working properly?

    I can use BLAT just fine with my SMTP service but this form just won’t cooperate.

    Just to make sure I’m doing things right what is the line number where the ini_set variable should go in the default form?

  329. 1525
    Camilo

    Great script!!! Thank you very much for making it available…

  330. 1524
    ful

    Do you think it could be possible to add a human verification like this one: http://www.codegravity.com/projects/mathguard (better than recaptcha i think)

  331. 1523
    Mark

    HTML e-mail including images in autoreply

    How would I make use of the autoreply to be able to send HTML mail and include (embedded) images?

    Any help would be appreciated. Thanks. Mark.

  332. 1522
    chico

    nevermid. it works. I had the wrong path to file.
    separate question: when I set the “still send email” option after saving to file, the POST page shows the “thank you” message on the same page without clearing the user’s info from the screen. It almost gives the impression that it hasn’t been submitted.
    however, this does not happen when setting the “still send email” option to TRUE

    thanks for the great script.

  333. 1521
    chico

    the save to file function isn’t working for me. Everything else works fine. I’m using standalone mode.
    I’ve already created the file of the same name specified in the function’s “save_path” variable, made sure the correct permissions are set, but nothing.
    Can you give me a clue as to what I could be doing wrong? Anyway to test if the feature is enabled on my server?
    thanks.

  334. Question: I’m just starting out seeing if this dd-formmailer.php script can be used for my needs, but my first question is that often clients desire 2 or more FORMS on a given page. The script does not seems to like being INCLUDEd twice as the second Form does not show at all. Does it not work this way?
    Thanks again.

  335. Have anybody tried to make a multy page form using the script? Is it possible at all to pass form fields values to a “thank you” page and further?
    I am trying to:
    1) Collect personal info from a visitor (name, e-mail, etc)
    2) Direct him to a service selection form (a different page) and I’d love to keep his personal details here (name, e-mail)
    At the moment I am using a redirect method described by the author – obviously the data from the first form doesn’t go to the second.

    Please advice anything! :)
    Many thanks

  336. 1518
    Feedback

    Form is not giving error when default option is not changed like it says it should when req=true.

    “If the field is required, the first option you have in the data paramater will be the default, which tells the user they need to select one of the options. If they do not change the default option, and it is required, they will receive an error.”

  337. Just a heads up for anyone with the same issue as me.

    Do not place the page content containing the –ddfm1– code inside another form code for styling. This will render the dd-formmailer.php ineffective. Instead place it inside of a div and use the dd-formmailer.css file to make appropriate adjustments.

  338. Ignore my comment… I realized I didn’t have the latest version installed so the installation instructions were not making sense. DOH!

  339. I have recently installed and customized the mail form and added three upload attachment fields. Wondering if someone could briefly explain where these attached files end up? Do they attach to the email as attachments? Or do they reside in the server somewhere with a link in the email to them? Do I have to make an upload folder writable on the server for this purpose? When testing, the form goes through to an email and confirmation page but without any attachment arriving. I really appreciate whomever can fill in my blanks.
    Thanks,
    Adrienne

  340. radio buttons on one line, instead of top-down

     form.ddfm .fmradio p  {
    	color: RED;
    	display:inline;
    	} 

    There are 2 cases of form.ddfm .fmradio p in the supplied css, so i think u might want to delete 1. However if you add this code:
     .ddfmwrap p.fieldwrap {
    	padding: 1px;
    	margin: 1px;
    	border:dashed yellow 2px;
    	}  
    you will see a dashed yellow border around the different fields. I notice the radio buttons lie outside where they should be, (or at least how every other type of field behaves)

  341. Hello, Wondering about the status of MySQL support. I see it was last year you hoped it was coming soon. Thanks for great script!!

  342. Hi sorry to bother you,
    We are trying to use the contact form as a form letter to contact politicians and are having recurring problems.
    1. the recaptcha breaks the form
    2. the content placed in the message structure part of the form does not appear on the contact page. Typing the message in the form struture doesn’t work either because we cannot use carrage returns.
    3. the field names appear in the sent e-mail. We want these contacts to be formatted like letters, not e-mails, can we get rid of these.

    Also can we hard code a list of recipients so that we can send each MP a letter and only their address appears. like this
    http://perishablepress.com/press/2008/06/09/wordpress-hack-multiple-email-recipients-for-contact-coldform/
    cheers
    gordon

  343. @Derrick I was having the same problem, and I don’t think there is a fix yet. I sent an e-mail about it a few months ago.

  344. Is this being monitored by anyone. The questions are unanswered and someone’s randomly submitting comments that make no sense.

    I need to know if there is a way to not have the form erase after an error message, when using the Manual Form Method. Thanks!

  345. I’m sorry about all the posts. Really frustrated that I can’t get this to work. As I said the page seems to work under IE7 but not under IE6. I am not getting the “Headers already sent error” but presumably something is being outputed to browser before the setcookie function is called which is why no cookie is generated.
    I am completely stumped what the cause is. I can create cookies on my website using this IE6 browser but it won’t create when I use this PHP script. I don’t see any whitespace either in the PHP file.
    I have copied the code to this file: http://gplocumcover.co.uk/comments.txt so you can look at the raw PHP code. Its got to be something really basic but not sure what it is. Even the raw code when I simply upload the dagon original formmailer script[and change the path's etc] has the same problem. Grasping at straws but does it need to be saved in a specific format ANSI/UNICODE/UTF-8?
    Really hope somebody can help out – its a great script and would really like to be able to use it to stop all the spam I was getting!
    Thanks

  346. 1508
    tommy

    Hi,

    Thanks for this script.
    I’ve managed to build the form inside my site, but I don’t know how to do the same when the user gets an error message. So everything works fine when the form is submitted properly, I created my own redirection page.

    But, for example, the user leaves out a required field the error message doesn’t appear inside my page.
    What part of the code do I have to modify?
    Thanks

  347. Problems creating cookie under IE6:
    I changed the Privacy settings under IE6 on the computer I am currently working on so that it would PROMPT when a cookie is created. The script is not generating a cookie at all under IE6 and hence why the “No verification code” error is appearing. Other websites I’ve tested are allowing cookies to be created.
    Why is it doing this and how do I get around the problem?
    Thanks
    http://gplocumcover.co.uk/comments.php

  348. I have the same question as Steve, and it’s vital that it’s responded to quickly. Customers are getting upset.

    I have a lengthy form with tedious information, however if 1 “required” field has an error, it erases the entire form.

    I’m using the Manual Form Method.

    Is there a way around this!

    PLEASE ANSWER! HUGE CLIENT! BIG PROJECT! AND REDOING THIS ENTIRE THING, WILL BE UPSETTING! PLEASE HELP!

  349. I don’t understand why the script works when I run it on my machine but when other people run it on their computers they say that it comes up “No verification code generated”
    I am testing the script on a different computer today and I get the same error above. The script seems to work in IE7 but has problems in IE6. I have checked and cookies are definitely enabled in the IE6 browser.
    Check out : http://gplocumcover.co.uk/comments.php

    Initially on a different computer I was working on, the script would always fail on the first attempt [even if the right code was entered] but then on the 2nd,3rd,4th attempts it would always go through okay. If I closed the browser and then opened it up again it would fail on the first attempt but would go through again on the 2nd,3rd,4th attempts.
    —————————————-
    Martin K #1490 suggested:
    @ Rhys

    Sounds like a cookie problem. There are several reasons why this can happen.

    Example 1: Testing the script with a browser and opening the formmailer in more than one tab/window can lead to the result you described (the browser stores only one verification code – the latest one).

    Example 2: You tested the script with browsers that are not capable to overwrite the old cookie with a new cookie after reloading the page.

    Example 3: You are using different URLs or you are working with frames.
    —————————————
    Its definitely not the first two explanations. What does using different URLs mean? I am indeed using frames

    What can I do to fix the problem. I’m sorry but I don’t know PHP. I have seen suggestion for adding session_start(); just under the php tag but this didn’t seem to do anything when I added it

    Thanks for any help,
    Rhys

  350. 1504
    gg

    Can this form pop up a message after user submit a form?

  351. Thanks Steve, you’ve actually solved my problem now as I was only using the Manual Form code to change the ‘Submit Email’ button and one other thing.

    Separately, does anyone (Admin?) know if there is any way to include a character counter next to the text box, so that as people use up their quota of characters in the message the counter counts down to zero? Thanks, Mark.

  352. An addendum:
    checkbox(’agree’) should read checkbox(’name’) for that example.

  353. 1501
    Steve

    @Earl
    Go to the lang folder and open up whichever language file you’re using (e.g. English.php). The first definition will say something like:

    define('DDFM_SUBMITBUTTON', 'Send Email');

    Simply change ‘Send Email’ to ‘Request’

  354. OK…Found the problem, but will post for anyone else that needs the solution. Did not have the full path to the lang folder. Simple but hard if you don’t catch it.

    NOW…for another question: How can I change the “Send Email” button on the form to “Request” ? Thanks for any help.

  355. When I make the form to put * by the required fields I get the DDFM_ names instead of the *.

    If I put false for the *, its ok, however, if someone does not fill the fields, I get:
    DDFM_ERRORMSGDDFM_MISSINGFIELD ‘Name’
    DDFM_MISSINGFIELD ‘Address’
    DDFM_MISSINGFIELD ‘City’
    DDFM_MISSINGFIELD ‘State’
    DDFM_MISSINGFIELD ‘Zip’
    DDFM_MISSINGFIELD ‘Email’
    DDFM_MISSINGVER

    How can if correct this? Thanks.

  356. 1498
    Steve

    Just one last attempt to establish this… am I right in assuming that once a form has been submitted and if errors are flagged up, there’s definitely no way to retain user entries in the form fields if the form was generated using Manual Form Code?

    It would be really good to have a way to do this, as while it’s not too much of a problem for basic forms, it’s a bit too much to expect users to re-enter each field for complex ones (and of course it’s likely to be complex forms that are the very reason for using Manual Form Code in the first place!)

    Relying on the browser back button is less than ideal as not all browsers remember a form’s contents.

    Can anyone else – or the script author – just confirm that this is unfortunately one of the limitations of the manual form code option?

    Thanks.

  357. 1497
    Steve

    @Web design,
    You should be able to do that in the CSS file. Look for:

    form.ddfm legend {
    	padding: 0 6px 0 6px;
    	margin: 0 0 0 10px;
    	} 

    and add the following line before the closing bracket:
    background: url(path/to/your/image.jpg) top left no-repeat;

    That’s how I would go about it anyway.

    (’top, ‘left’ and ‘no-repeat’ are obviously variable properties – not sure how familiar you are with CSS but Google ‘background property CSS’ for more info about positioning your image)

    HTH.

  358. Is there anyway that you can have images appear in the fieldset legend?

    Basically i want to include html in the legend section of each of the fieldsets i create.

  359. 1495
    mhalvorsen

    I have tried to get the multiple recipients select field to work on two different servers with no luck. It has no problem sending the automatic response, but no emails are sent when the multiple recipients field is used. I copied the exact code on this site in the example only changing the email addresses with no luck.

    I also changed the:

    
    $send_status = mail($send_to, $email_subject, $msg, $headers, '-f test@mysite.com');
    

    and corrected the quote problem, but it still doesn’t send the form. Like I said, it has no problem sending the auto response. I tried it on two different servers with two different companies, no luck.

    Anyone have any ideas? I tried looking through the comments.

  360. John and Steve (1491 and 1496) I have now also gone with the stand alone option and introduced some manual form code (follow the link at the bottom of this page: http://www.soulfoodcinema.com/filmsn/namesake/namesake.html) and am also having the same problem as you two. The data is there if I press back on my browser but it would help to have it in the form below, otherwise I will have to try and incorporate a message somewhere telling people what to do if they get errors.

  361. I have the script running successfully until today. Someone tried to submit a school and they receive a “page cannot be displayed” error when they hit submit. I tried again and it worked fine. What would cause this to fail for one user yet work for many others?

  362. 1492
    Steve

    John Skillings (Post 1491) – I have the same issue as you, and I’d love an answer.

    I can incorporate quite a complex form into this script using the ‘Manual Form Code’ option, but then if after pressing submit it flags up any user errors (missing field, etc), it doesn’t retain each field’s contents as it does with the normal method – in other words, the user has to type them ALL in again.

    I understand that some sacrifices may need to be made to enable the flexibility of having this ‘Manual Form Code’ option, so I’d be interested to know from the script author if what I (and you) describe above is meant to happen – or if we’re doing something wrong.

    If this is one of the consequences of using the Manual Form Code, is it something that can be addressed in a future release?

    Once again – great script! Would just like to know the answer to this one.

  363. 1491
    james

    Nevermind. Fixed it.

  364. 1490
    james

    Everything seems to work fine with this except Recaptcha.

    The box shows up and everything looks good but I am able to type in anything in the box and it still sends the mail.

    ???

  365. Hi, I put these comments in the ‘contact’ form, but think I should’ve posted them here.

    Okay. I have the form set up fine – if you follow the ‘Readers’ Comments’ link at the bottom of this page: http://www.soulfoodcinema.com/filmsn/namesake/namesake.html and leave comments all is fine… so long as they are entered okay. But if not the error messages come up on the /dd-formailer.php page instead of the /comments.html page where the form is located, making it look pretty amateurish. Can anyone help me in getting the error/missing field message to come up on the same page as the form please?

  366. 1488
    artemis

    Hi,
    Anybody to customize my form.
    I need a better presentation because the one is generated with Php is ugly.
    thanks for your help.

  367. Hi,

    I am trying out the Manual Form Code, and was able to integrate a rather complicated form (selects, radio buttons, check boxes, text areas) in my form.

    The problem I am seeing is that the Manual Form Code does not retain the state. By this I mean, if you make an error, on a form refresh, you lose all the data (some of that has been validated previously). For example, if you have select a Title, and not filled in an e-mail address, when you submit the form, the script is automatically resetting the Title also to original state.

    It is interesting that the Advanced Form Structure does not have this problem. It is able to save the state, and upon error, only prompts you enter the values that need to be validated.

    Not sure if I am doing any thing wrong, but any help in resolving
    this problem will be appreciated.

    Thank you.

    John

  368. 1486
    Martin K.

    @ Rhys

    Sounds like a cookie problem. There are several reasons why this can happen.

    Example 1: Testing the script with a browser and opening the formmailer in more than one tab/window can lead to the result you described (the browser stores only one verification code – the latest one).

    Example 2: You tested the script with browsers that are not capable to overwrite the old cookie with a new cookie after reloading the page.

    Example 3: You are using different URLs or you are working with frames.

  369. 1485
    Rhys

    I sent the last message on the forum as well. I have been testing the form on a couple different computers at different places I work in.
    I notice that on some computers the very first time the page loads it says that either “a code could not be generated” or that the “code entered was invalid” even though the code entered was correct. the second time they enter the code the page goes through okay. Subsequent message I sent go through first time but if i close down the browser window and then open it up again the first time the from runs it comes up with an error but then works fine on the 2nd,3rd,4th etc attempt. Other computer run the form first time without any problems.
    does anyone know the cause and how to fix it?
    thanks for your help

  370. 1484
    Rhys

    Thank you for writing the formmailer script. I have it up and running on my website and it works a real treat.
    Because the email is sent to my googlemail account – googlemail has a tendency of grouping email messages into conversations. I would prefer to have them come through as separate emails so I could deal with each one independently and then archive each one independently. It group conversations by the email address from field. If a user doesn’t specify an email address the script assigns a fake email address of user@domain.com. If more than one user does this though google will group the separate messages all with the same from “user@domain.com” into a conversation.
    I was thinking an easy way of getting around this would be to create a unique email address FROM field by using the string that stores the value for the inputted verification code i.e. fm_verify as this is likely to be different each time the form is generated e.g. so the email address from field would be e.g. 38BDF@hotmail.com etc
    so when i replace the line:
    if (trim($sender_email) == “”) {
    $sender_email = ‘user@domain.com’;
    }

    with
    if (trim($sender_email) == “”) {
    $sender_email = fm_verify. ‘@hotmail.com’
    }

    or even $sender_email=”fm_verify”.’@hotmail.com’;

    but it just sets the sender_email to the string: fm_verify@hotmail.com while I want it to be e.g. 38BDB@hotmail.com

    I have read a little about string handling in PHP – am I just making a very simple mistake with the quotes?

    thanks for your help

  371. 1483
    Jaap

    Hi,

    Already found it myself !

    I changed :

    $recipients = ‘mail@mysite.com’;

    into :

    $recipients = ‘to=mail@mysite.com|bcc=mail2@mysite.com’;

    Now it works.

    Jaap.

  372. 1482
    Jaap

    Hi,

    I have the form send to one emailaddress like this :

    $recipients = ‘mail@mysite.com’;

    It worked great for now, but now I want it send also to another address BCC

    I found in the documentation this:

    to=mail@mysite.com|bcc=mail2@mysite.com

    but I cannot get it to work, hope someone can tell me how to change the original line of code
    to add one BCC emailaddress.

    Thanks in advance

    Jaap.

  373. 1481
    momper

    hello

    nice script!! is it possible to attach to some formelements a style attribut like style="margin-bottom:0px;"

  374. 1480
    SteveP

    Re:1483
    I found that the Language folder had not copied to the website correctly, and this is one of the variables set in the English.php file. Sorted!

  375. 1479
    SteveP

    Everything works, except I get DDFM_REQUIREDTAG in front of every field. If I turn off the Required option, it goes, but shouldn’t this just be an asterisk?
    When I searched on Google for DDFM_REQUIREDTAG, I found a few more sites with the same problem, so it’s not just me!

    Any ideas?

  376. 1478
    Greg

    Seems that the new feature “Save Data to File” is not working properly.
    Although I am using $save_to_file = FALSE; the script writes data into the data.txt.

  377. 1477
    fabio

    This is a great script and would like to keep it on my website.
    Now I would like to know how to program this script to connect with mysql database.
    just need to store all the datas sent by each email.
    thanks for any help.
    Fabio

  378. asdfsdfsd

  379. I’ve been deluged with spam and looking for a while for a good, solid PHP formmail script with captcha support, and this one is SO close to being absolutely perfect it’s frustrating.

    Handles complex forms smoothly, instant ReCaptcha integration, fast, highly configureable, easy to set up–darn near perfect.

    …except that I’m trying to throw some HUGE and fairly complex forms at it, and while the Manual Form Code mode lets me put exactly what I want on the page, it doesn’t support re-filling fields if there is a failure in the submission (bad captcha or omitted required field). Total deal breaker, given the size of the forms, and makes me weep a little inside.

    Here’s hoping that’ll be a feature added in the future! (Either that, or a way to insert instructive text between elements in an auto-generated form.)

  380. I’ve tried about FIVE different forms in my blog and I always ended up having some PHP mail config problems but you DD form worked like a charm! Amazing! Effortless! Thank you so much!

  381. I have searched the comments but with so many posts, I may have missed the answer. I would like to change the background color of the Message Box only and put a border around it. I can’t figure out what needs to be changed / added in the CSS file. Any and all help is appreciated.

  382. 1472
    Martin K.

    I think I discovered a bug or an unwanted effect (I’m using version 5.33 but I had a short look into version 5.41 and it seems that this bug is not fixed yet).

    If You write something like
    Smith, John
    instead of John Smith into the name-field (fm_name), it can happen that the From-field (and some other fields) of Your e-mail-header will consist of two senders.

    The comma is a delimiter for e-mail-addresses. The more commas the more senders.

    To avoid such an effect the string with the name has to be double quoted, because inside double quotes the comma and other special characters have no special meaning for a mail transfer agent.

    It should be like this example:
    "Smith, John"

    The full From-field would look like this:
    From: "Smith, John" <smith@example.com>

    Changing the script to use double quotes for the name of the sender is simple. But make sure that no other double quotes are inside the string.

    This example would destroy the string:
    "John "The King" Smith"

    I hope I could make my point clear, because English is not my mother-tongue.

    Martin ;-)

  383. Whoops thought I was posting on the other page. lol

    Anyhow same link needs fixing on:

    http://www.dagondesign.com/articles/secure-form-mailer-plugin-for-wordpress/

  384. Sorry forgot to mention.

    The link for this part is invalid:

    Modifying the script to use HII for image verification

    Miro has posted instructions for users wanting to use HII: Read the comment. Notice: Modifications listed in the comments may not apply for new versions of the script.

    Should link to:

    http://www.dagondesign.com/articles/secure-php-form-mailer-script/all-comments/#comment-67245

    Because they way you have it now it will not take you to the comment because that link was only good if your already viewing the correct page that that comment is on. Of course every time a new page is “created” that would change so only way to have it working so user can go right to it is using above.

    More user friendly. ;)

    Thanks!

  385. Version 5.41 has been released

    Saving form data to a file is now supported! Please see the new options for usage information.

    This update also includes a few minor fixes. It will no longer produce errors if the recapcha lib is already being loaded from another script, and the headers have been adjusted for file attachments.

    Enjoy!

  386. How much would you charge to get your form mailer script to work on my AskQuestion.htm page?

    I fear getting the beautiful script to work is beyond me, and I don’t want to clobber my site or hard drive.

    Thanks! April

  387. Please disregard my previous message on usage and how you open the .php file. Figured that out.

    Thanks,

    April

  388. Great script.

    But how do I arrange it so the input fields (textboxes) show below the subject field?

    Thanks