---
title: "Securing your osCommerce contact form with the Simple Captcha Add-On"
description: "When you install osCommerce, you will have a Contact form by default set up for your shop. The Contact form provided works well, except, there is no validation preventing robots from filling the form..."
url: https://www.inmotionhosting.com/support/edu/oscommerce/oscommerce-contact-form-captcha-add-on/
date: 2013-04-23
modified: 2021-08-16
author: "InMotion Hosting Contributor"
categories: ["OsCommerce"]
type: post
lang: en
---

# Securing your osCommerce contact form with the Simple Captcha Add-On

[![Default contact form osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha.png)

When you install osCommerce, you will have a Contact form by default set up for your shop. The Contact form provided works well, except, there is no validation preventing robots from filling the form out. This article will explain how to secure your website contact form using the Simple Captcha Add-On.

## Download the captcha module

[![Download captcha plugin osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-1-download.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-1-download.png)

Before you can set up the captcha on your contact form, you will need to download the files from the osCommerce Add-On site. Visit the link below and download the *osC-2.3.1-simple-captcha-1.2.zip* file with the Add-On code.

[https://addons.oscommerce.com/info/7822](https://addons.oscommerce.com/info/7822)

Once you get the *osC-2.3.1-simple-captcha-1.2.zip* file on your computer, follow the steps below.

## Steps to add a captcha to your contact form

1. [![Copy captcha files osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-2-copy-files.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-2-copy-files.png) **[Upload](/support/website/how-to-edit-a-file/)** the files in the catalog folder to your osCommerce installation directory.
2. [![Copy image to the server osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-3-copy-image.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-3-copy-image.png) **[Upload](/support/website/how-to-edit-a-file/)** the example-bh63v.jpg image file to your images directory in your osCommerce installation folder.
3. [![Rename the image osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-4-rename-image.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-4-rename-image.png) **Rename** the image to captcha.jpg.
4. [![create a new folder osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-6-new-folder.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-6-new-folder.png) **[Create](/support/website/create-new-file/)** a folder in your osCommerce installation folder and call it “*fonts*“.
5. [![Upload the font osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-7-upload-font.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-7-upload-font.png) **Upload** your font to the font directory for the captcha to work
6. [![Edit the validation file osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-5-validation.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-5-validation.png) **[Edit](/support/website/how-to-edit-a-file/)** the following file. /includes/functions/validations.php
7. [![Add the captcha code to the file osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-8-add-code.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-8-add-code.png) **Paste** the following code into the *validations.php* file before the `?>` at the bottom of the page. define('CAPTCHA_FONT', DIR_FS_CATALOG . 'fonts/truetypefont.ttf'); define('CAPTCHA_LOAD', 'images/captcha.jpg'); define('CAPTCHA_IMAGE', DIR_FS_CATALOG . CAPTCHA_LOAD); **Note!** You will need a font uploaded. Make sure you change the *truetypefont.ttf* file name to your font file name. In this case the path will be *AeroviasBrasil.ttf*. **Save** the changes. [![Final view of captcha osCommerce](https://www.inmotionhosting.com/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-9-captch.png)](/support/wp-content/uploads/2013/04/edu_oscommerce_202_captcha_captcha-9-captch.png) Now visit your website where the contact form is and you will see the captcha on the page.
