Add Captcha to Sugar CRM Web to Lead forms

Posted by: Admin  :  Category: Web Hosting

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony


Capturing leads via web based forms is something that is pretty standard in many industries that rely on internet marketing for sales.

One of the many leading CRM (Customer relationship management) systems, which also happens to have an open source “community” edition is Sugar CRM.

Out of the box, Sugar CRM community edition does not offer the ability for anti-spam measures such as captcha. By default, implementing a web to lead form that integrates Sugar onto your public facing website appears to become a magnet for spam form submissions. Spammers can scrape indexed google results for specific fingerprints that are indicative of “spammable” web forms. This can happen quickly after implementing a form, as your site gets re-indexed by google.

Sometimes it can be very bad, which for us, it motivated us to implement reCaptcha (Google’s Captcha library) with the web to lead Sugar CRM forms.

It was much easier than we thought. Here’s how to do it with your Sugar CRM web to lead form :

Implement Recaptcha right near your submit button on the form

Add the following code (or the code in reCaptcha’s latest instructions) :

<form id="WebToLeadForm" action="" method="POST" name="WebToLeadForm"><!--?php require_once('recaptchalib.php'); $  publickey = "your_public_key"; // you got this from the signup page echo recaptcha_get_html($  publickey); ?--> <input type="submit" /></form>

Its important to note that you’re not fundamentally altering how the Sugar CRM web to lead form works. Your just including the recaptcha library and displaying the captcha input box, with the captcha image of course.

The form, at this point, will still submit and be processed by Sugar regardless of what you enter in the captcha box. The next step is to include the recaptcha “check” in the actual Sugar Lead processing function.

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Basically the recaptcha check, out of the box, does a simple check of the captcha input and “dies” if the input is incorrect. If its correct, you can put whatever php code in the “else” statement, which in Sugars case would be the actual form processing.

Process the captcha and submit the lead form

For Sugar CRM 6.5.x, the file you want to edit is modules/Campaigns/WebToLeadCapture.php. This file is supposed to have a check built in that allows you to overwrite this file with a leadCapture_override.php file in the root folder. This allows the changes you make to be “upgrade safe”, meaning that if you upgrade sugar, the changes wont get overwritten.

Here is the recaptcha “check” that verifies captcha input :

Notice the “else” statement at the bottom, thats what you want to have the Sugar code that processes the lead form execute. You dont want Sugar to do ANYTHING if the captcha was not verified.

Edit the WebToLeadCapture.php file and add the above code around line 58, or above the following code that starts checking the html form’s POST values :

if (isset($  _POST['campaign_id']) &amp;&amp; !empty($  _POST['campaign_id'])) {

Simply put the else statement right above the above code, and ensure the opening and closing brackets for the recaptcha else statement encompass all the subsequent code, right to the bottom of the file, ensuring the closing bracket is below the following line :


Hopefully this will help reduce your spam entries with your Sugar CRM lead forms!

The post Add Captcha to Sugar CRM Web to Lead forms appeared first on Managed WordPress Hosting | Managed VPS Hosting | Stack Star.

Managed WordPress Hosting | Managed VPS Hosting | Stack Star

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Using Captcha Scripts to Prevent Spam

Posted by: Admin  :  Category: Web Hosting

Security is perhaps one of the most important aspects of a web hosting plan, especially for webmasters that conduct a significant volume of e-commerce on a daily basis. A single security lapse could lead to widespread data loss, site downtime, slow loading pages, and a reduction in daily traffic levels. However, one security issue that is often overlooked and underestimated is spam, which is defined as any excessive and/or forceful communication with or use of a Web server or online system. Although web hosting providers offer integrated modules that are specifically designed to help webmasters maximize spam prevention, there are certain measures that website owners can take to completely eliminate site spam.

Why Should Spam Be Prevented?

Spam is a threat not only to the security but also to the productivity of every online business. Most websites become successful because of their continually updated content, which is of a high quality that visitors gain interest in. However, if your site becomes heavily populated with unmoderated spam comments and low-quality content, it is possible to experience a significant reduction in daily traffic levels and search engine rankings. In fact, it is even possible to be completely de-indexed from some search engines because of a large volume of spam on your site. Spam can also be seen in the form of automated e-mails that are submitted through contact forms on your website. E-mail spam can cause webmasters to waste a lot of time in cleaning up their inbox, reducing productivity and ultimately lowering the value and responsiveness of their customer service.

What Is a Captcha Script?

A captcha script is basically a script that is installed on your website which displays a unique image containing a random combination of characters (including letters, numbers, and sometimes symbols), which visitors must input into a form box to verify that they are not automated robots. Since captcha scripts actually create unique images spontaneously, bots are not able to read or decode them as they would be able to do with regular text. As computer programs are not able to actually view and interpret images, it is extremely unlikely that a bot will be created in the future that can decipher captcha images. Thus, captcha scripts are an effective long-term way to prevent automated spam and ensure that all of your site commenters and anyone sending you an e-mail is actually a human being.

How to Use Captcha Scripts

To use a captcha script you simply need to paste the code snippet into the coding of any form or input field. This will cause the script to randomly generate a captcha image any time the form is loaded on a webpage, making it so no information can be successfully entered into the form without the visitor first solving the associated captcha. Captcha codes can be generated in various programming languages, including PHP, ASP, and NET, making it a flexible and highly compatible spam prevention tool that can be utilized on any web site.

Web Hosting Geeks’ Blog – News, Trends, Discussions.