One more CAPTCHA.
Generate an CAPTCHA image using GD library and true type fonts (TTF).
Download
Printable View
One more CAPTCHA.
Generate an CAPTCHA image using GD library and true type fonts (TTF).
Download
Thank you.. great contribution
v 2.0 05.03.2007 8:20
1. Generate CAPTCHA code when img displaing;
2. Add Redraw ability;
3. Add redraw_button function;
I just installed this plugin. Great work !
much more better than the one we can find in the download section.
Thx ;)
demo please?
You can find this plugin in action here :
http://82.225.9.97/zencart_temp/inde...age=contact_us
It adds CAPTCHA in create account, tell a friend, contact us, links submit and I added the CAPTCHA in "write a review".
:thumbsup:
i installed the other one already, can I install this ?
Before anyone installs this do checkout Megaman's Demo.
Although the CAPTCHA image generated by this mod is of high quality and far less prone to getting "found out by bots", it is also sometimes difficult for a human to identify one or more of the image characters (due to a character getting cut off out on the edge or due to overlapping characters).
If you find it difficult to identify an image character, think how your customers might fare. And most importantly think about how they might respond.
Maybe best to add a message:
"If you cannot identify one of the characters above please click the redraw button to generate a new character set"
I'm not at all dissing this mod and thank Andrew as he has done the Zen Cart community a service in implementing this much improved CAPTCHA.
Just be aware of potential issues before installing.
Woody
I wanted to ask: Does anyone running Zen Cart (1.37 or previous) without CAPTCHA have an issue with bot registrations?
Many have reported issues of bots using the contact form or other Zen Cart related email forms, but wondering if anyone has observed issues with account registrations by bots (if CAPTCHA was employed or not).
Woody
I am using zencart for a project.
The goals were to use a CMS and then make attacks on the others.
I putted CAPTCHA only in registration's form.
I got about 10000 reviews in one night, and the attacker was friendly because he told me that he was doing this. He used some extentions for firefox, so nobody can do it.
By the way, I had to create a php script to remove the reviews, nothing in the admin panel allows to remove mass messsages in one time :/
And another attack was in the "tell a friend".
The emails aren't check, nobody can put "FROM email" = "email of your e-commerce" or "TO email" = "email of your e-commerce". That means that, without CAPTCHA again, nobody can autospam you just by repeating one HTTP message. Worst, there is no limit to the message the user can put.
I will make a big review at the end of this project :)
Thanks Andrew and Megaman for the info.
As Andrew is aware, I installed the mod on my test shop on dev server (with many mods installed) and the CAPTCHA image would not display.
So I installed mod on my dev server on a fresh ZC 1.37 install (on local network) and the CAPTCHA image still does not display.
I tried changing from default png to jpeg in the class file and still no display.
Thinking that I might have corrupted fonts so re-uploaded the three supplied font files in FTP Binary mode. I don't know how to test if TTF's are corrupted or not.
Or maybe the fonts list is not getting read properly?
Any special GD or PHP version requirements or custom path settings or special server configuration needed for the CAPTCHA image display to work?
I can see in the HTML source (both Firefox and IE6) the mod is attempting to do it's job.
Any other ideas? Thanks.Code:<fieldset>
<legend>Verification code:</legend>
<img id="captimg" src="captcha_img.php?0.690452001173098496" alt="" width="240" height="50" />
<input type="image" src="{path to my redraw button edited}" alt="Redraw Capture Image" title=" Redraw Capture Image " onclick="document.getElementById('captimg').src='captcha_img.php?'+Math.random();return false;" />
<br class="clearBoth" />
<label for="captcha">Verification code:</label>
<input type="text" name="captcha" id="captcha" />
<span class="alert">* (case insensitive)</span>
<br class="clearBoth" />
</fieldset>
Woody
v 2.2 15.03.2007 16:12
1. Use zen_href_link to generate img address;
2. Add Review Write page support (Thanks to Mega Man);
3. Add french language (Thanks to Mega Man).
Woody!
Try last version.
Thanks Andrew ... but after updating to 2.2 CAPTCHA image still does not display. :sad:
I'm out of ideas to fix my problem. I'm sure it is a simple fix.
Thanks for adding option to change image type in admin and thanks for the new font :wink2:
Also regarding write reviews support, after SQL patch I indeed see new "write review" option in Config > CAPTCHA.
But CAPTCHA form does not show up on Product reviews write pages.
So I think need to edit/upload:
/includes/modules/pages/product_reviews_write/header_php.php
-AND- /includes/templates/your_template/templates/tpl_product_reviews_write_default.php
Woody
On second thought I discovered write reviews structure is different from contact us and tell a friend. Thus I couldn't pinpoint the location in header file and how error checking/validation occurs on the write reviews form. Is the above header_php.php file correct, and is so how to edit to support CAPTCHA?
INSERT (somewhere):
INSERT (somewhere else):Code:// BOF Captcha
if(CAPTCHA_REVIEWS_WRITE != 'false') {
require(DIR_WS_CLASSES . 'captcha.php');
$captcha = new captcha();
}
// EOF Captcha
Code:// BOF Captcha
if (is_object($captcha) && !$captcha->validateCaptchaCode()) {
$error = true;
$messageStack->add('friend', ERROR_CAPTCHA);
}
// EOF Captcha
I just downloaded the new version but in fact some important files are missing for the support of the "Write Reviews" pages
:)
I will mail a_berezin to tell him.
Fixed................
UPDATE:
I see in web server error log:
Code:[error] PHP Fatal error: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png: fatal libpng error: zlib error in /home/my_account/public_html/my_shop/includes/classes/captcha.php on line 214
The segment of relevant code from the class file:
Code:if($this->img_type == 'png') {
imagepng($this->img, '', (int)$this->quality);
} elseif($this->img_type == 'gif') {
imagegif($this->img, '');
} else {
imagejpeg($this->img, '', (int)$this->quality);
}
So for testing I changed image type (Config > Captcha) from png to jpeg and try again... but image still does not display in browser. However this time different message in error log:
Does this last error indicate a possible htaccess mod-security issue?Code:client denied by server configuration: /home/my_account/public_html/my_shop/includes/templates/my_template/images/index.php
How to change to gif? Config > CAPTCHA in the admin provides png and jpeg options but don't see how to set gif image type.
Woody
My local dev server is set-up with register_globals disabled (just like the production server I want to run the mod on). Could this be cause to my issue?
Megaman, do you have register globals on or off on your demo site?
Woody
v 2.3 16.03.2007 10:51
1. Some Admin configuration adjustments added;
2. Remove non CAPTCHA updated code from Review Write page;
3. Add gif support;
Ha! I figured that much out. Just was inquiring if anyone had ideas how to resolve. My local server is set-up to emulate my production server on webhost. If it does not run on my local server then it will not run on web host. But to be certain I just installed a fresh Zen cart on same host machine production shop is running on and installed previous version of your mod (v2.2) and same exact errors observed. Hosting provider grepped through the server logs and did not find anything unusual but observed same errors in the server error log. He asked me if the mod requires register_globals enabled. I stated I did not know but probably not as the mod developer is super security conscious.
How would I test if CAPTCHA mod requires register_globals?
OK I will install and test the new version.
Anyone have ideas what might contribute to above reported errors? Thanks for any recommends.
Woody
Tips:
Script for testing CAPTCHA:
Code:<?php
require('includes/application_top.php');
require(DIR_WS_CLASSES . 'captcha.php');
$captcha = new captcha();
if(isset($_POST['action']) && $_POST['action'] == 'GO') {
if($captcha->validateCaptchaCode())
echo 'You enter VALID code - "' . $_POST["captcha"] . '"';
else
echo 'You enter INVALID code - "' . $_POST["captcha"] . '"';
}
?>
<form action="<?php echo $PHP_SELF; ?>" method="post">
<?php
// BOF Captcha
if(is_object($captcha)) {
?>
<?php echo $captcha->img(); ?>
<?php echo $captcha->redraw_button(BUTTON_IMAGE_CAPTCHA_REDRAW, BUTTON_IMAGE_CAPTCHA_REDRAW_ALT); ?>
<br class="clearBoth" />
<label for="captcha"><?php echo TITLE_CAPTCHA; ?></label>
<?php echo $captcha->input_field('captcha', 'id="captcha"') . ' <span class="alert">' . TEXT_CAPTCHA . '</span>'; ?>
<br class="clearBoth" />
<?php
}
// EOF Captcha
?>
<input type="submit" name="action" value="GO" />
</form>
Woody!
I use this CAPTCHA more than six months on different hosting. And only you have so problems.
How can I help you if you can't give me any usefull information or url for you test site?
Andrew,
Thanks for the follow-up and the upgrades!I discovered there is one diff between the two servers. The production shop was recently moved to a server with different version of PHP. Not sure why I forgot something so significant.
Anyway, the good news is I now have your new v.2.3 CAPTCHA working on PHP 4.4.4. I see many nice new v2.3 options in admin!
But mod v2.2 is still not working on the server running PHP 5.1.6. Thus I will try your test script and also install new mod version 2.3.
Woody
Installed v.2.3 (on server running PHP 4.4.4)
Good News: I can change the width and height of the background image and change the code length. And the shadows appear behind the characters. And the random diagonal lines appear behind the characters.
Bad News: The redraw button does not respond. And the characters are small and vertical, and not rotated as expected. In admin (Config >CAPTCHA) I changed the max and min "chars" sizes to no effect.
I've tried all three image type options (png, jpeg, gif) to same effect.
All of the above applies to both the contact_us and login page.
Before I spend too much time investigating thought I'd check to see if others observe the same with v2.3.
Woody
Thanks again for the test script Andrew.
I installed both the test script and v2.3 on on Zen Cart 1.37 on a host running PHP 4.4.4 and all is good (well a few errors as reported above but the image displays in both Firefox and IE6).
But the test script does not display image on Zen Cart 1.37 running on PHP 5.1.6.
Not wanting to jump to conclusion but is there possibly a PHP version compatibility issue here?
Could others whom have success with the mod and/or success running the test script above, please post their PHP version? Thanks.
Woody
v 2.4 20.03.2007 11:39
1. Support for GD 1;
2. Use of a class dir instead of function opendir;
Woody!
Test this version.
Andrew-
Regards to upgrading from v1.33 to 1.34 it looks like the only file needing updating was the classes file, so that's what I did.
Same issues continue. CAPTCHA image does not display on the shop running on PHP5.
Error log entry shows:
And I tried out your new _test_captcha.php with same negative result.Code:File does not exist: /home/ergo/public_html/403.shtml
client denied by server configuration: /home/account/public_html/shop/includes/templates/my_template/images/index.php
I do see IMAGE_CAPTCHA _ALT displays where the CAPTCHA image should be. I'm assuming this a new define that needs to go into the language file?
Below is the generated source from the contact_us page:
All of the above is for the shop running on PHP5.Code:<img id="captimg" src="http://www.domain.com/shop/captcha_img.php?0.588261001174405752" alt="IMAGE_CAPTCHA_ALT" title=" IMAGE_CAPTCHA_ALT " height="50" width="240">
<input src="includes/templates/my_template/buttons/english/button_redraw.gif" alt="Redraw Capture Image" title=" Redraw Capture Image " onclick="document.getElementById('captimg').src='http://www.domain.com/shop/captcha_img.php?'+Math.random();return false;" type="image">
<br class="clearBoth">
<label for="captcha">Verification code:</label>
<input name="captcha" id="captcha" type="text"> <span class="alert">* (case insensitive)</span>
<br class="clearBoth">
I updated to v1.34 CAPTCHA on the server running PHP4 and the CAPTCHA image still displays. But font size remains tiny. Changing values for 'Chars minimum size' and 'Chars maximum size 'has no effect.
I am not understanding the meaning of "(1.0=Image Height)". Is that reference to pixel size or relative aspect ratio or some percentage of something?
Besides the default values I tried 24.0 and 36.0 respectively.
Is there anything I can tell my hosting provider what to look for regards he support required for this CAPTCHA mod.
I'm thinking possibly some server security configuration is disallowing the 0.588261001174405752 parameter appended to http://www.domain.com/shop/captcha_img.php?
<img src="http://www.domain.com/shop/captcha_img.php?0.588261001174405752">
Appreciate your advice and assistance in trying out different ideas.
Woody
Thanks for that tip. And indeed after deleted the only TTF in the fonts directory the CAPTCHA image still displays with the six characters still at the same size. So knowing this will assist me in focusing my troubelshooting.
Ahhh... now I understand. 0.9 means the characters will display at 90% of the pixel height of the CAPTCHA image. Thanks for the clarification.
And FYI, I just submitted a follow-up message to my webhost regarding issue of the CAPTCHA image not displaying properly. I'm quite convinced now that some filtering rule(s) are in place causing the image to not display. I recall a similar error message a month ago or so when my shops product images generated by Image Handler 2 mysteriously quit displaying. After hemming and hawing over thias issue for two days the web host tech finally recalled they began "experimenting" with filtering on files ending with x80 (to protect against some infiltration technique tha's going around). Well if you have Image Handler 2 installed and you configure your small product images to display at 150wx80h size the filename will be appended with 150x80. Thus the webhost filtering rules put a stop to my product images for several days until they could figure out (remember) what they did to cause the issue. Doh! Document your changes boys and girls!! Needless to say they lost some credibility points on that one.
Woody
Further testing shows the characters in the CAPTCHA image disappear after the verdana.TTF font is deleted AND when the three previously provided fonts (captcha_0.ttf...) are uploaded to the /fonts directory.Quote:
Originally Posted by woodymon
So that indicates the script is ndeed "seeing" the /fonts directory.
Wondering why the CAPTCHA characters don't display when the old fonts are installed but with no fonts installed, generic characters display.
Something is funky with this picture :wink2:
Woody
Just delete the "glob" thing from _getFileList it finally works on my server.
PHP Code:
function _getFileList($directory, $file_ext) {
$file_list = array();
if ($za_dir = @dir(rtrim($directory, '/')))
{
while ($filename = $za_dir->read()) {
if (preg_match('/\.' . $file_ext . '$/i', $filename) > 0)
{
$file_list[] = $directory . $filename;
}
}
sort($file_list);
}
return $file_list;
}
Exist but didn't work.. Very strange. And what your hoster talk about this?
What a problem with ob_* functions in captcha_img.php? They prevent any output in application_top.php.
I just tried it on my other machine - WinXP with EasyPHP 1.8 (Apache 1.3.33 - PHP 4.3.10 - MySql 4.1.9) and same thing. On the XP/EasyPHP machine, I had to remove ob_start and ob_end_clean from showCaptchaImg before it could work. After that captcha shows fine on my XP.
I suppose it does exist because PHP > version 4.3
It's ok - I just had to remove those and it's looking good. My feedback: maybe you can find better color for the fonts? The colors just look ... you know .. :yuck: yucky... hehehe
You have enough of knowledge to self-make it. See
Code:var $backgroundColor = array(array(220, 220, 220), array(255, 255, 255));
var $linesColor = array(array(150, 150, 150), array(185, 185, 185));
var $textColor = array(array(30, 30, 30), array(199, 199, 199));
Nevermind nevermind
Yes! The changes above to /includes/classes/captcha.php
solved my problem of the characters displaying.
Looks good!
So issues on PHP 4.44. shop are solved.
But still no image displays on PHP 5.1.6 shop.
My host says problems are with the script not their service (of course they would say that). If I can point them in the right direction they will help but I'm clueless.
Woody
I forgot to include error log entry:
Does this indicate a server security setting amiss or any other ideas?Code:File does not exist: /home/account/public_html/403.shtml
client denied by server configuration: /home/account/public_html/shop/includes/templates/my_template/images/index.php
I asked host to look in their mod_security rules but that came back negative.
Woody
Anyone else have issues with this script on PHP 5.1x ??
Just checking before I fire my web host :wink2:
Woody
Host says they observe no file index.php created
in /home/account/public_html/shop/includes/templates/my_template/images/
Is this index.php suppose to be created (and destroyed) on the fly each time the captcha image is generate?. Or is index.php only created in memory, not ever written to disk?
My web host says that file needs loaded into the images directory, so that is my problem. But the mod does not come with index.php file.
Is there an ez method availabe to adapt the mod to write the file to disk (as a png, gif or jpg) just to ensure the image is created.
My host asked if there was a "debug" version of the script available.
Woody
I jumped to conclusions. After making the edits recommended the CAPTCHA module is working. But seven new errors showing up in error log each time.
The line numbers above refer to the following header code in function showCaptchaImg() within /includes/classes/captcha.phpCode:error PHP Warning: Cannot modify header information - headers already sent by (output started at /home/account/public_html/shop/includes/classes/captcha.php:276)
in /home/account/public_html/shop/includes/classes/captcha.php on line 152
in /home/account/public_html/shop/includes/classes/captcha.php on line 151
in /home/account/public_html/shop/includes/classes/captcha.php on line 150
in /home/account/public_html/shop/includes/classes/captcha.php on line 149
in /home/account/public_html/shop/includes/classes/captcha.php on line 148
in /home/account/public_html/shop/includes/classes/captcha.php on line 147
in /home/account/public_html/shop/includes/classes/captcha.php on line 146
This is for the shop on PHP 4.4.4.Code:header('HTTP/1.0 200 OK');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');
header('Content-Type: image/' . $this->img_type);
header('Content-Length: ' . strlen($this->img));
I'm suspecting this is related to error I reported in shop running PHP 5.16
Recommends anyone? Thanks.
Woody
OK. So you're stating that by implementing the edits as I did, that is the casue of the error log entries.
OK. But if I did not make the recommended edits the mod does not work for me.
So it is a Catch-22.
As babygekko recommended I commented out in /classes/captcha_img.php
1. the if (function_exists('glob') structure
2. ob_start() and ob_end_clean()
Is there a suggested method to make the mod work WITHOUT the error log entries?
I will provide access credentials to view if you wish to check out.
Woody
1. Use of function glob can be really problematic. It's possible to refuse it.
2. Other question, IMHO it's a question to babygekko.
Looking at http://www.php.net/ob_start
Note the statements:
" Some web servers (e.g. Apache) change the working directory of a script when calling the callback function."
- and -
"the solution provided by PHP, does not function as intended when running PHP as a CGI (on CGI mode (CGI-BUILD (--enable-cgi) and/or CLI)"
And then later, code recommends that "works on both the non-CGI and the CGI PHP processor types".
Is this possibly relevant to the issues I have reported?
Woody
Hi. I just installed this on 1.3.7 (upgraded from 1.3.6). When I went to my Log In page, I got:
Fatal error: Cannot redeclare class captcha in /home/nakayama/public_html/includes/classes/captcha.php on line 12
I used to have the "other" mod installed, and I uninstalled it to the best of my knowledge (wasn't sure how to do it in MySQL, so I deleted the table and something else related to the mod...)
Thanks,
Katie
I should mention that I'm using a split login page for Paypal Express Checkout.
I followed your suggestions and kept the glob function commented out, and then uncommented:
ob_start();
ob_end_clean();
And everything is cool on the PHP 4.4.4 shop :thumbsup:
So now on to solving my issue on the PHP 5.1.6 shop, which will become the new home for the 4.4.4 shop, that is whenver I can get this captcha issue resolved. :wink2:
Thanks again for the assist!
Woody
KTNaturals!
I could not reproduce this error. Check once more uninstalling "other" mod.
v 2.5 23.03.2007 13:11
1. Remove "glob" function;
2. Add error messages constants;
3. Add session id to captcha_img.php href link;
4. Use direct output (no output buffer used);
5. The functions generateCaptcha(), createCaptchaImg() and showCaptchaImg() are incorporated in one function generateCaptcha();
I discovered the above error was unrelated to CAPTCHA mod install (I was inadvertently calling an image in tpl_header). So no more errors in the error log.
As a refresher on my issue, the captcha imaged won't display on my 5.1.6 shop but displays on shop running PHP 4.4.4.
The same goes for displaying captcha image via _test_captcha.php or on the create-account or the contact_us pages.
In IE I see the broken image icon and ALT tag "Enable this picture" and the outline of where the captcha image should display. Firefox shows the same for a split second when clicking the redraw button.
The below access log entry created when accessing the shop's contact_us page looks normal...
[23/Mar/2007:11:59:49] "GET /shop/index.php?main_page=contact_us HTTP/1.1" 200 4755 "http://www.domain.com/shop/index.php?main_page=index"
When I click the captcha redraw button on the contact_us page I observe the following entries in the access log:
[23/Mar/2007:11:59:52] "GET /shop/captcha_img.php?0.836195001174669189 HTTP/1.1" 200 7682 "-"
And when I click the redraw button again:
[23/Mar/2007:12:00:02] "GET /shop/captcha_img.php?0.4578382568536792 HTTP/1.1" 200 9592 "-" [/quote]
So it appears the mod is functioning fine, other than displaying the captcha image.
If it is relevant below are gd related entries in phpinfo():
The above is same on the server running PHP 4.4.4. where the captcha image correctly displays.Quote:
gd
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XPM Support enabled
XBM Support enabled
I'm looking for a needle in a haystack here. Could it be something in the Apache config/environment which might be the issue? Any other ideas why the CAPTCHA image will not display on the PHP 5.1.6 shop? If there is any other info I can provide let me know. And thanks for your recommends.
NOTE: The above was with Andrew's v.3.4 mod. I will install 3.5 and report back.
Woody
v.3.5 works fine on php 4.4.4 shop. But PHP 5.1.6 shop did get any better :sad:
Woody
Hi, Andrew.
I verified that the other mod is uninstalled. As for SQL, I'm not really sure since I don't know it at all. What I did was do "DROP TABLE IF EXISTS anti_robotreg;", and went into the DB and deleted the CAPTCHA Validation from configuration_group (or something like that). I attached the install SQL file for reference. Could you tell me what else I need to do?
I'm also having a display problem on both my live site and my test site on the Contact Us page. The center column extends all the way to the right.
http://www.ktnaturals.com/catalog2/i...age=contact_us
Any help would be appreciated. Thanks!
installed the mod, however there is no image showing
there is a "re-draw" button but no image:down:
OK. Solved the "Cannot redeclare class..." problem. I had to delete some old files that had file names with *.php.bak.
Still having a display problem with Contact Us page...
Woody!
Enter direct address in your browser - http://<your_domain>/captcha_img.php.
What you see? And what you see in html source code?
v 2.5a 24.03.2007 16:00
1. Add captcha_debug.php.
Firefox says:
The image “http://www.domain.com/shop/captcha_img.php” cannot be displayed, because it contains errors.
I tried v.2.5a:
1. Copied updated includes/classes/captcha.php
2. Copied new captcha_debug.php
3. Pointed browser to http://www.domain.com/shop/captcha_debug.php or to http://domain.com/shop/captcha_debug.php
4. Firefox web browser displays empty page
If I view the empty browser page's "generated source" (with Firefox web developer) all I see is:
WoodyCode:<html><head></head></html>
Here is what my host reported back regarding the inability to display the captcha image when running the script on the host with PHP5:
Then he suggested moving the shop back to a host running PHP4. That's not going to happen.Quote:
I have checked the php.ini of both servers, and while there are significant differences between php4 and php5, the same set of functions are restricted on either server. So the only significant difference between the two hosts is the version of php.
Any others out there running this captcha script (even the new 2.5a debug script) on PHP5? If so which versions?
Woody
Sorry, Woody. I can't help you.
Anyone else have this mod working on PHP 5.x?
Anyone else having troubles running this mod on PHP 5.x?
Woody
Woody!
I add some debug settings to captcha_debug.php. Downlod and run it.
It's last chance.
Andrew-
Sent you a PM containing the new debug output and a few notes.
And after sending the PM I removed Session Watcher v.1.01 mod. But captcha image still does not display.
If you find anything peculiar in the captcha debug report please let me know.
Thanks again for your assist in solving this puzzle.
Woody
Woody!
I see your debug output. It's fine! :thumbsup: All works normal, image generated.
The generated image does not display. That is the crux issue. Sorry if I haven't been very clear on that.
Possibly something in the header of the image or the image encoding, or issue with the method the server is delivering script output the client? Maybe http header issue?
Host just sent me a few notes on differences in the debug script output when run on the host with PHP4 vs PHP5. Not sure if the points are relevant or not. But I will gather those details and post shortly.
Woody
Woody!
I think that it's a non-PHP problem.
Check your hosting, your .htaccess.
Hey Woody and Andrew,
I'm having the same problem with the Captcha image not displaying. I'm on GoDaddy shared hosting with PHP 4.3.11. When I run captcha_img.php on the browser I get:
When I run captcha_test the image is also not displaying.Quote:
The image “http://www.patiotoys.com/captcha_img.php” cannot be displayed, because it contains errors.
I don't know if there's a solution yet, but I wanted to be in on any solutions that do come up. Let me know if there are any settings I can try massaging.
-Roger
Hi Roger,
Thank you for your report. I was going wacko thinking I was the only one with this issue.
My webhost is quickly tiring of my communications on this issue. They keep saying it is a problem with the script or an "authoring" issue. I say NOT! I'm convinced it is a server configuration issue. But if I am wrong I will eat crow (but I prefer turkey).
Several months ago my hosting company messed up (we are apparently a live guinea pig) and added mod_security rules which prevented the serving of my production shop's product images. Took the webhost two days to find problem and repair (apparently they did not document their changes and they could not remember what they changed... go figure).
A similar rule might be causing the captcha_image to not get served (get filtered). But webhost consistently responds no rules are in place which would filter the image. I suspect otherwise but don't know how to prove as I have no access to server wide rules or server wise error logs (I can access my own error log but that is all clear). Such is life in a shared host environment.
They are aware of this thread and I'm amazed they have not responded or posted here. I would think they would want to learn? I know I do!
Does your host employ mod_security? Any special server wide/global rules applied?
Have you tried testing by quickly and temporarily disabling your .htaccess files? (remove the period in front of htaccess. Be sure to change back quickly after testing). I just tested doing that myself and did not help.
I will PM you latest debug script Andrew sent me. If you learn anything please do post. And I'll do the same.
And an EXTRA BIG thanks to Andrew with helping troubleshoot this issue!
Woody
I switched from GoDaddy about a month ago because my shop ran so s l o w... As I put more products into my shopping cart, it got slower, like 5 seconds to load a page with hardly any graphics. They don't know how to configure their servers to run e-commerce apps. I switched to PimaHost (pimahost.com), and I am VERY happy. My shop is FAST!!
Anyway, I still have a few months left on GoDaddy. If I have some time this week, I can try installing the mod on it to see if I have the same issue. In the mean time, don't even try calling them for support - they'll tell you in a roundabout way they're only responsible for server hardware...
Andrew (or anyone),
I'm not sure if I'm the only one having this problem but I'm getting that "This page contains both secure and insecure items..." blah blah from IE. I've tried hitting captcha_img.php from the https loca. but it just spits out "The image “https://www.lethalperformance.com/captcha_img.php” cannot be displayed, because it contains errors.". If I could get it to work in ssl mode I'm sure I could hack up the code a bit to determine when to enable the ssl link for it.
Thanks for another kick-*** contrib!
Excuse my ignorance, read the posts but just want to make sure.
This download replaces (appears that it is suggested that you remove the previous CAPTCHA prior to loading this one) the download section CAPTCHA (which only protects the customer sign up process) and provides protection for both the sign up process AND contact_us submission?
Just looking for confirmation if someone has the time. Hoping it's all true, certainly needed.
UPDATE: Webhost just applied identical mod_security rules to both machines. No changes observed. Sigh.
So I stand corrected as I was pointing to a mod_security issue. I now eat crow.
captcha image correctly displays on one server but does not on the other machine. Error in browser is: The image “http://www.domain.com/shop/captcha_img.php” cannot be displayed, because it contains errors.
Webhost reports the machines are identically configured except PHP4 on one and PHP5 on the other (the latter hosting the account which the captcha image will NOT display).
Any gurus out there with ideas on what might be contributing to the image not displaying (I have confirmed with Andrew's debug script the image is generated).
Something special regards to Apache configuration or MIME types or HTTP headers or...?
Woody
Woody!
I install PHP 5.1.6 (Zend: 2.1.0) on my local server an test captcha. All works fine.
Can your host company give me a test account for two days? 1Mb+php5.
a_b,
any advice about getting your mod to cooperate w/ ssl? Depending on the user's settings they may just not see the image at all, or at best they'd get a warning about "This page contains both secure and insecure items...". Thanks again.
j_3,
I can't test it on ssl.
Woody!
I test it PHP 5.2.1 (Zend: 2.2.0). All work normal.
Hi, I too was getting this "secure and nonsecure" issue when I click on the login link. I did some reading and searching, this is what I did to solve this issue.
edit this file /includes/classes/captcha.php
At line 64, change from
$this->img_href = zen_href_link('captcha_img.php', zen_session_name() . '=' . zen_session_id(), 'NONSSL', false, false, true);
to
$this->img_href = zen_href_link('captcha_img.php', zen_session_name() . '=' . zen_session_id(), 'SSL', false, false, true);
Notice the underlined word to be changed. Works for me.
Hope this helps. :thumbsup:
Cheers,
KennyOz
http://cheekyjunior.com.au
Hi KennyOz,
Thank for the decision!
Fixed.
Glad you solved you problem!
My question got, understandably, buried during the serious discussion of the real time issue so I thought I would ask it again.
Again, excuse my ignorance, read the posts but just want to make sure since it really wasn't confirmed:
This download replaces (appears that it is suggested that you remove the previous CAPTCHA prior to loading this one) the download section CAPTCHA (which only protects the customer sign up process) and provides protection for both the sign up process AND contact_us submission?
Just looking for confirmation if someone has the time. Hoping it's all true, certainly needed.
Thanks.
That is correct. The other version is quite differet than this one, so make sure to remove everything. There's no SQL uninstall script, so you'll have to manually remove entries from the database (you might not need to do this, but if you don't, it'll still appear in Admin).
This version can also do Tell a Friend and Reviews.
QUESTION: Can anyone confirm they have the captcha mod working on Zen Cart 1.37 with IH2 and/or Zen Lightbox installed?
UPDATE on my ongoing issue...I moved the account on which captcha was working (on host with PHP4) over to the same host where captcha was not working (with PHP5). So both accounts are now running on same machine.
I've confirmed captcha IS still working on the moved account (on the host with PHP5)!
So this issue is specific to the specific account and/or Zen Cart install/config! Nothing to do with PHP or mod_security. Sorry for the wild goose chase.
So this leaves me to ponder: why the diff on accounts on the same host? I've installed latest mod v2.6 on both accounts (both running Zen Cart 1.37).
The Zen Cart which captcha works has NO mods installed.
The Zen Cart which captcha does NOT work has MANY mods installed including Image Handler 2 and Zen Lightbox.
I'm wondering if we have a mod compatibility issue?
Repeat Question: Can anyone confirm they have the captcha mod working on Zen Cart 1.37 with IH2 and/or Zen Lightbox installed?
Woody
Thanks, this one looked involved so wanted to head off any problems.
SQL! Oh Nooooo!
Though I've done inserts in Admin. I've never hand added/deleted anything.
Any clues as to entries to remove and procedure?
Going to give it a shot. Tried "browse" and I see "CAPTCHA validation" in configuration_group but that is the only thing I see based on guessing what to look from from Captcha original SQL insert but looks like there should be something else. Specifically, 'Anti-Robot Registration/Verification'.
Search of entire database shows "activate validation" somewhere in "configuration" field but I can't seem to find that entry.
Am I close? Just delete the "CAPTCHA Validation" line?
Thanks for the time, keep thinking I'm near done then there's another great mod! Security is top in my mind so I don't want to rush to live prematurely.
Woody!
Certainly it works with Zen Lightbox. And with all other normal mods. :)
That with IH2 I do not know. I didn't try, didn't install, didn't look and didn't touch this :censored:.