Forums / All Other Contributions/Addons / Captcha using TTF & GD

Captcha using TTF & GD

Views: 147,342

Results 441 to 460 of 593
21 Dec 2008, 4:59 PM
#441
lumpylumpy avatar

lumpylumpy

New Zenner

Join Date:
Feb 2008
Posts:
27
Plugin Contributions:
0

Captcha using TTF & GD

Hi to all, my captcha was working great until it stoped.I dont hnow why or wen.I have ZenCart 1.38a
I checked all the filles and fonts and they whare OK and i place.
Captcha in on every page but i get ENABLE THIS PICTURE and nothing shows up, not even on captcha_test.php or captcha_debug.php.
I installed the new version Captcha using TTF & GD 2-9, still the same problem.
I installed the older version again, still the same problem.
I have reverted to backups, still the same problem.
I have checked the server configuration and i have GD libraries enabled.
I dont know what else to check.I have tried everything from this thread.
Somebody has eny suggestions? any....:no:
Thanks, Zoli.

21 Dec 2008, 8:05 PM
#442
worldmaker avatar

worldmaker

Zen Follower

Join Date:
Jul 2006
Location:
Manchester
Posts:
139
Plugin Contributions:
0

Re: Captcha using TTF & GD

lumpylumpy:

Hi to all, my captcha was working great until it stoped.
Thanks, Zoli.

Zoli,

My first impression is that, if you did absolutely nothing to your store before the event, then you ought to look at your server/service provider and ask if they did anything to their server configurations.

Explain that you're using zen cart (they ought to be familiar with it) and see what they say.

From your post I wonder if you've tried a clean installation from your offline copy of the cart? You DO have a full copy of all your store's original files from before the problem?

:unsure:

"Why dumb down when we can rise up?" Worldmaker / BonDevZone Store

21 Dec 2008, 11:20 PM
#443
lumpylumpy avatar

lumpylumpy

New Zenner

Join Date:
Feb 2008
Posts:
27
Plugin Contributions:
0

Re: Captcha using TTF & GD

Hi worldmaker, i did not try a full backup off my shop, i have done that now and the captcha WORKS.
Now all i have to do is to search and compare.Since the backup i have done some customisation to my cart.
I am going to dig in to this now.....
THANK FOR THE TIP.

22 Dec 2008, 9:26 AM
#444
worldmaker avatar

worldmaker

Zen Follower

Join Date:
Jul 2006
Location:
Manchester
Posts:
139
Plugin Contributions:
0

Re: Captcha using TTF & GD

lumpylumpy:

Hi worldmaker, i did not try a full backup off my shop, i have done that now and the captcha WORKS.
Now all i have to do is to search and compare.Since the backup i have done some customisation to my cart.
I am going to dig in to this now.....
THANK FOR THE TIP.

Glad I could help.
The easiest way to deal with any upgrading is to use a test copy of your store, either online alongside your live store, or offline on a standalone PC. That saves a lot of problems when you do carry out a major change, or upgrade.

:smartalec:

"Why dumb down when we can rise up?" Worldmaker / BonDevZone Store

23 Dec 2008, 1:01 AM
#445
chrx avatar

chrx

New Zenner

Join Date:
Aug 2005
Location:
SF Bay Area, California, USA
Posts:
84
Plugin Contributions:
0

Re: Captcha using TTF & GD

worldmaker:

I'm having a problem with the Contact Us page.

I seem to have installed the mod. correctly, and there are no other mods., etc., running on my site to cause conflicts.

Captcha works on the login function, and it works on the captcha_test.php file, but it doesn't work on the Contact Us page for my test shop.

The captcha IS appearing but it's not locking out users (Test dummy one - me) :smile:

This means that anyone can enter a message and hit send without completing the captcha and they'd be allowed to go ahead.

I'm running it on Zen 1.3.8a with no other problems (because I've locked everything else out).

I haven't made any modifications that I can recall on the Contact Us template page.

Any thoughts or suggestions?

:unsure:

Worldmaker,

I had more-or-less the same problem and found this thread, which showed me what I did wrong:
http://www.zen-cart.com/forum/showthread.php?t=102613&highlight=CAPTCHA+validation

Basically, I re-named the old version of the pre-existing file, in its pre-captcha form to filename_BAK.php, to have it as a backup, while using the original filename.php for the new version of the file with captcha.

Removing that original, renamed file, so only the updated, captcha'd version was in the directory solved the problem. Now it works like a charm. Check out that thread shown above. If it does not help everyone, it deserves a review anyway, as it solved the problem for me!

Cheers, chrx

23 Dec 2008, 9:11 AM
#446
worldmaker avatar

worldmaker

Zen Follower

Join Date:
Jul 2006
Location:
Manchester
Posts:
139
Plugin Contributions:
0

Re: Captcha using TTF & GD

chrx:

Worldmaker,

I had more-or-less the same problem and found this thread, which showed me what I did wrong:
http://www.zen-cart.com/forum/showthread.php?t=102613&highlight=CAPTCHA+validation

Basically, I re-named the old version of the pre-existing file, in its pre-captcha form to filename_BAK.php, to have it as a backup, while using the original filename.php for the new version of the file with captcha.

Removing that original, renamed file, so only the updated, captcha'd version was in the directory solved the problem. Now it works like a charm. Check out that thread shown above. If it does not help everyone, it deserves a review anyway, as it solved the problem for me!

Cheers, chrx

Chrx,

Thanks for the thought, I'd done the same and only after advice from Andrew did I understand the problem and remove the backup copy of my original, unedited, file, but it's nice to know there are answers elsewhere too.

And if you do still want to keep the original unedited version of your .php file the answer is to rename it "(myfile).php.backup" or similar to stop it from being recognized as a functional .php file.

:blush:

"Why dumb down when we can rise up?" Worldmaker / BonDevZone Store

23 Dec 2008, 5:37 PM
#447
chrx avatar

chrx

New Zenner

Join Date:
Aug 2005
Location:
SF Bay Area, California, USA
Posts:
84
Plugin Contributions:
0

Re: Captcha using TTF & GD

This morning I added "Captcha clarification" copy in an effort to help our site visitors who may not understand what they are looking at. Believe me, they are out there! Just added it to the Contact Us page at this point...

Here's what it looks like:
http://www.bhjdynamics.com/index.php?main_page=contact_us

Here's what I added to file
includes/templates/our_template/templates/tpl_contact_us_default.php:

// BOF Captcha
if(is_object($captcha)) {
?>
<br class="clearBoth" />

  • ADDED THIS LINE --->* <?php echo '<br />' . INTRO_CAPTCHA . '<br /><br />'; ?>
  • EDITED THIS LINE --->* <?php echo $captcha->img() . '<br />  ' . TEXT_CAPTCHA_REDRAW . '  '; ?>
<?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 ------------------------------

Here's what I added to file
includes/languages/english/extra_definitions/captcha.php:

  • ADDED THIS DEFINITION --->* define('INTRO_CAPTCHA', 'In our effort to combat email spaming, BHJ now requires all contact emails to include verification. Please type the letters and numbers shown below into the verification code field.');

  • ADDED THIS DEFINITION --->* define('TEXT_CAPTCHA_REDRAW', '(If this image is unclear, click the redraw button.)');

  • EDITED THIS DEFINITION --->* define('TITLE_CAPTCHA', 'Enter verification code shown above:');


Just thought I'd post this, in case anyone else wants to tailor the user experience.

Cheers,
chrx

23 Dec 2008, 7:14 PM
#448
worldmaker avatar

worldmaker

Zen Follower

Join Date:
Jul 2006
Location:
Manchester
Posts:
139
Plugin Contributions:
0

Re: Captcha using TTF & GD

Chrx,

Couldn't you have just added the formatted text to the tpl....php file? Saves having two files edited and the problems of keeping track of your edits?

:cool:

"Why dumb down when we can rise up?" Worldmaker / BonDevZone Store

24 Dec 2008, 12:29 AM
#449
chrx avatar

chrx

New Zenner

Join Date:
Aug 2005
Location:
SF Bay Area, California, USA
Posts:
84
Plugin Contributions:
0

Re: Captcha using TTF & GD

worldmaker:

Chrx,
Couldn't you have just added the formatted text to the tpl....php file?
:cool:

I'm just trying to stay within the established methodology of the ZC workspace.

Doing it the way I did will enable me to drop the same definitions into the other Captcha-edited templates (Tell A Friend, Reviews, etc.) and when I need to make a global copy edit, I can do it in the referenced language definition file only (captcha.php) and it will be reflected in all templates containing that definition. Beats having to manually edit every template.

Ahhh, dynamically-generated web pages!

Regarding keeping track of my edits - I add my name to the header of every ZC file I edit. Then, if I need to run an upgrade or archive all edited pages for any other reason, I just search for my name in Admin/Tools/Developers Toolkit and it shows everything.

Cheers, chrx

24 Dec 2008, 8:04 AM
#450
worldmaker avatar

worldmaker

Zen Follower

Join Date:
Jul 2006
Location:
Manchester
Posts:
139
Plugin Contributions:
0

Re: Captcha using TTF & GD

chrx:

Regarding keeping track of my edits - I add my name to the header of every ZC file I edit. Then, if I need to run an upgrade or archive all edited pages for any other reason, I just search for my name in Admin/Tools/Developers Toolkit and it shows everything.

Cheers, chrx

Ooooo, I LIKE that idea!

:D

"Why dumb down when we can rise up?" Worldmaker / BonDevZone Store

26 Dec 2008, 6:05 PM
#451
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Captcha using TTF & GD

I finally got Captcha to work on all of my sites. I found the problem.
I had an empty enter, new line or space at the end of my english.php located in includes/languages/YOUR_TEMPLATE/english.php

This must have happened when I edited some lines for the footer customization. Hard to see with the editor. I just hit delete a few times at the end of the file and made sure no extra space or anything remains. If you have the same problem that there is no captcha, just the "Enable this picture" text, check out your english.php in your template override folder. Last thing in the file has to be just ?>

Don't know why this affected Captcha only but not the other customizations in the english file. All other customized text in the file worked just fine.

Live and learn... the Zen way.

26 Dec 2008, 11:17 PM
#452
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Captcha using TTF & GD

mydanilo:

I finally got Captcha to work on all of my sites. I found the problem.
I had an empty enter, new line or space at the end of my english.php located in includes/languages/YOUR_TEMPLATE/english.php

Interesting... I have spaces at the end of my english file and Captcha works! May be the editor is leaving something behind... I use Notepad++ for editing.

I did come across something the other day that may shed some light for some. I added some rewrites to my .htaccess file to stop hotlinking. Without thinking I added png to the list. After that, no captcha image would show. Removed png and it was back... I use png images for my layout and captcha so that shouldn't be a problem for me.

mydanilo -- Glad to hear you got yours worked out.

Dave
Always forward thinking... Lost my mind!

27 Dec 2008, 12:05 AM
#453
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Captcha using TTF & GD

Yea, I am glad too. :yes:

I use Notepad ++ too. I had issues before when editing files that there were some additional things left in it that I did not see, but they caused problems. Not sure how to prevent this....
I already set it to not do word wrap.

I saw the problem when I did a winmerge and compared with an out of the box english.php. Winmerge showed me that extra thing just before ?>.

Live and learn... the Zen way.

27 Dec 2008, 7:38 PM
#454
gsdcypher avatar

gsdcypher

Totally Zenned

Join Date:
Feb 2007
Posts:
816
Plugin Contributions:
0

Re: Captcha using TTF & GD

if i wanted captcha just on the contact us page... and i don't want to merge the captcha files with my current files... can i just upload the contact us files and NOT upload the other files?

should i also delete reference to the other files from the sql patch?

thanks.

28 Dec 2008, 11:26 AM
#455
worldmaker avatar

worldmaker

Zen Follower

Join Date:
Jul 2006
Location:
Manchester
Posts:
139
Plugin Contributions:
0

Re: Captcha using TTF & GD

gsdcypher:

if i wanted captcha just on the contact us page... and i don't want to merge the captcha files with my current files... can i just upload the contact us files and NOT upload the other files?

should i also delete reference to the other files from the sql patch?

thanks.

To the best of my understanding you can certainly limit the captch to the pages you want and ignore the rest, and you can leave the SQL untouched, so don't worry about having to edit it; but you will have to edit/replace the appropriate files for the pages where you do want to implement the captcha.

Set up a test copy of your site if you have the capability, and try it out there first.

:cool:

"Why dumb down when we can rise up?" Worldmaker / BonDevZone Store

28 Dec 2008, 2:07 PM
#456
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Captcha using TTF & GD

Yes, you can just add captcha for your contact us page. that what i did on my site , I didn't even install the SQL patch .. it will work without the patch , but limit you to default number of chars on captcha , i think is 4 character by default.

28 Dec 2008, 5:35 PM
#457
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Captcha using TTF & GD

If you don't do the sql to setup the defaults, you can edit the class file and replace the variable defaults with what you want.

You also need to remove the IF statement in the tpl_ and Header pages for it to work.

if(is_object($captcha){

and the trailing }

Here's another tidbit... if you don't want Captcha for login customers, this is what I added...

In the header and tpl_ page replace the IF statement with this..

if(is_object($captcha) && (!$_SESSION['customer_id'])) {

If they are login, I don't drive them nuts trying to read a captcha image..

Dave
Always forward thinking... Lost my mind!

30 Dec 2008, 12:29 AM
#458
gsdcypher avatar

gsdcypher

Totally Zenned

Join Date:
Feb 2007
Posts:
816
Plugin Contributions:
0

Re: Captcha using TTF & GD

thanks everyone...

i uploaded just the basic files and the contact_us files.
i installed the sql (unedited).

i have the captcha only on the contact us page.
i can edit the parameters via the admin.
and everything "seems" to be working.

Thanks!

18 Jan 2009, 12:39 AM
#459
nagelkruid avatar

nagelkruid

Zen Follower

Join Date:
Nov 2006
Posts:
284
Plugin Contributions:
0

Re: Captcha using TTF & GD

davewest:

if(is_object($captcha) && (!$_SESSION['customer_id'])) {
Yes, i did that too, should probably be better default.

Did anyone manage to code a snapshot if someone fails the matching code that they don't have to rewrite the whole form.

I want them just to retry the code and not redo the whole form again.

Thanks,
Jeroen

3 Feb 2009, 10:32 PM
#460
nikki72 avatar

nikki72

New Zenner

Join Date:
Dec 2008
Posts:
97
Plugin Contributions:
0

Re: Captcha using TTF & GD

Hello,
I wanted to add this option to my return authorization form. I have search for link with instructions..but couldn't find any... does anyone know how to get this to work with return authorization form? I tired but to no avail :(.

thanks nicole