Securing your osCommerce contact form with the Simple Captcha Add-On
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
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.
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
- Upload the files in the catalog folder to your osCommerce installation directory.
- Upload the example-bh63v.jpg image file to your images directory in your osCommerce installation folder.
- Rename the image to captcha.jpg.
- Create a folder in your osCommerce installation folder and call it "fonts".
- Upload your font to the font directory for the captcha to work. In this tutorial we are using the Aerovias Brasil font available here.
- Edit the following file.
- 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.
‹Section 2: How to Secure Your osCommerce Site with the htaccess/htpasswd
We value your feedback!
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.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!
Adding security to osCommerce
|1.||How to Secure the configure.php File for osCommerce|
|2.||How to Secure Your osCommerce Site with the htaccess/htpasswd|
|3.||Securing your osCommerce contact form with the Simple Captcha Add-On|
2014-11-19 10:22 am
I am getting this error:
Warning: require(includes/template_top.php) [function.require]: failed to open stream: No such file or directory in /home/pt000071/public_html/store/catalog/contact_us.php on line 76 Warning: require(includes/template_top.php) [function.require]: failed to open stream: No such file or directory in /home/pt000071/public_html/store/catalog/contact_us.php on line 76 Fatal error: require() [function.require]: Failed opening required 'includes/template_top.php' (include_path='.:/opt/php5/lib/php') in /home/pt000071/public_html/store/catalog/contact_us.php on line 76
new to oscommerce
2014-11-19 11:06 am
Sorry you're having problems with osCommerce. The error indicates that the referenced file "template_top.php" doesn't exist. This may be a part of your installation that is damaged, or the reference to the file may need to be corrected. However, the problem is that we need more info on how the error started. Where you installing something? Can you describe the steps you take to generate this error (if steps are required)? Where does this error occur? It would help to have a URL. What version of osCommerce are you using?
We basically need more information in order to provide assistance with this issue. Please provide this information and we would be happy to help.