Installation - PHP Contact Form Script

Prerequisites

  • Web server that support PHP 7.0 or greater (PHP 8.0 ready)
  • HTML editor
  • For Windows, we recommend using Notepad2.
  • For MacOS, we recommend using Brackets.

Step-by-step instructions

  1. Download kontaktformular.com.zip from the downloads section.

  2. Unzip the file kontaktformular.com.zip in a folder on your hard drive.

  3. Open config.php with an HTML editor (we recommend using Notepad2 or Brackets).

  4. Insert your email address between the quotation marks in line 3 and your (company) name in line 5. The exact position is specified in a comment in the file. You can toggle the mandatory field to consent to the data privacy policy (EU GDPR) in line 7. Type 1 to activate the field and 0 to deactivate it. If you want to change the link to the data privacy policy, you can do so in line 9. In line 11, you can customize the link to the thank-you page. (Pro tip: Have the thank-you page appear outside the iFrame.)
    Spam protection options: Activate or deactivate any spam protection options (honeypot, click check, time-out, or bad word filter, among others) you like in lines 18 to 38. To activate or deactivate visible spam protection functions (security code or question), edit lines 18 and 20 respectively.
    Copy to sender: This option (line 45) lets you determine when the user receives a copy of the message: always, never or only with the user’s authorization.
    HTML5 error messages (optional):: Edit line 47 to activate or deactivate modern HTML5 error messages.
    SMTP function (optional): Add any applicable information in lines 56 to 66.
    Attachment / Upload function (optional): Add any applicable information in lines 75 to 92.

  5. Save the config.php file.

  6. Upload all files to your server or web space. Important: Do not alter the directory structure (see image).

  7. Open test.php in your browser, insert your email address and click on send. This will test whether PHP function mail() is installed on your server. You should receive a test email within a couple of seconds. For security reasons, delete the test.php file after completing the test. You did not receive an email? Click here!

  8. Open contact.php in your browser. The contact form is now ready to use! (If you do not see the visible spam protection element [security code or question] after activating it [config.php file], click here.)

    Read the FAQ for answers to frequently asked questions (layout, technical issues) and any potential error messages.

    Customers of Hosteurope and Strato please click here.








Integrating the form into your website



There are two ways of inserting the contact form into your website. You can either use an iFrame (very easy, also supports responsive design) or a PHP include command. Embedding the form with an iFrame is the simplest solution. (it also works in WordPress!)


Embed with iFrame

Insert this HTML code into the website where you want the form to appear:

<iframe src="contact.php" style="border: none; width:100%; height:700px; margin: 0 0 0 1%;"></iframe>

  1. Ensure that the path to contact.php is correct. If the file is in a directory (e.g. contact_form), change the path to: "contact_form/contact.php".

  2. Use the "height" attribute to define the height of the iFrame. Alternatively, you can automatically adjust the height as well using this responsive iFrame.
    Info: Use a frame breaker script for the thank-you page if you use the responsive iFrame.

  3. You’re done!




Possible error messages

You cannot see the security code?

  1. If after installing the form it does not display a security code, open document_root.php (in the captcha folder) in your browser. You will now see the absolute server path.

  2. In my example, it is: /home/www/

  3. Select the absolute server path and copy it to the clipboard. (right-click with the mouse - copy)

  4. Open captcha.php (in the captcha folder) in the editor and scroll down to line 64. ($ttf = "/Imperator.ttf";)

  5. Important: Insert the absolute server path from the clipboard in front of /imperator.ttf. (right-click with the mouse - insert)

  6. In my example, this would be: $ttf = "/home/www/Imperator.ttf";

  7. The font is not in the root directory (main directory) of your server, so you will have to specify the location in the path.

    If, for example, the contact form is in the contact-form folder, the path needs to look like this: $ttf = "/home/www/contact-form/captcha/Imperator.ttf";

    (You should also remember to insert the captcha folder, as the font is stored in there. ;-) )

  8. Now you should be able to see the security code.


Free installation service

Should you have any problems installing or configuring the software, our free installation service is available to you at any time. Use our contact form to let us know and provide your contact information. We will get in touch with you within 24 hours!


Info

This script lets your visitors contact you. The form is sent to the web master by email. The security code fends off spam. As an option, you can also include a field for an email attachment. Do not remove the copyright notice in the footer of the script. If you want to remove it, you will have to purchase a non-copyright license. Please fill out this order form to do so. If you want to use the contact form on a commercial website, please purchase a commercial license. You can also use the same order form to do so. Before downloading, you have agreed to this by accepting the licensing conditions.


Custom Form

We also program custom, responsive HTML and PHP contact forms for your homepage. Contact us now.