Default contact form osCommerceWhen 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 osCommerceBefore 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.

http://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 osCommerceUpload the files in the catalog folder to your osCommerce installation directory.
  2. Copy image to the server osCommerceUpload the example-bh63v.jpg image file to your images directory in your osCommerce installation folder.
  3. Rename the image osCommerceRename the image to captcha.jpg.
  4. create a new folder osCommerceCreate a folder in your osCommerce installation folder and call it "fonts".
  5. Upload the font osCommerceUpload your font to the font directory for the captcha to work. In this tutorial we are using the Aerovias Brasil font available here.
  6. Edit the validation file osCommerceEdit the following file.
    /includes/functions/validations.php

  7. Add the captcha code to the file osCommercePaste 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 osCommerceNow visit your website where the contact form is and you will see the captcha on the page.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve our Support Center:
Email Address
Optional, but our team may contact you for more information.
Like this Article?

Post a Comment

Name:
Email Address:
Comment:
Are you a bot?
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Write New!
Do you want to publish a tutorial to our support center?

News / Announcements

SSL Certficate Warnings
Updated 2014-04-14 11:34 am EST
Hits: 2225
Heartbleed 0-day OpenSSL security bug
Updated 2014-04-14 04:43 pm EST
Hits: 5647

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!