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

Captcha using TTF & GD

Views: 147,342

Results 361 to 380 of 593
11 Sep 2008, 1:33 PM
#361
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Captcha using TTF & GD

Use captcha_debug.php and captcha_test.php for testing.

NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

11 Sep 2008, 1:41 PM
#362
mydanilo avatar

mydanilo

Totally Zenned

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

Re: Captcha using TTF & GD

Ooops, just found out what was wrong!

I just noticed the captcha_img.php in the root folder. I only uploded the includes and font folders and forgot to upload the captcha_img.php!! Maybe this was the problem for some other people too:blush:?

Live and learn... the Zen way.

12 Sep 2008, 3:08 AM
#363
davewest avatar

davewest

Totally Zenned

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

Re: Captcha using TTF & GD

romy:

Anyone know how to add captcha to ask a question mod.
Thanks:(

Romy, if you copy the code from the Contact Us set to your Ask A Question set it will work.

Ask A Question files to edit;
includes/modules/pages/as_a_question/header_php.php
includes/templates/YOUR_TEMPLETE/templates/tpl_ask_a_question_default.php

look at the 'contacts us' pages in the same folders and copy the code between the BOF Captcha and EOF Captcha to the same location in ask a question.

This will use the same on/off as contact us. If you wish to have it's own, then on the header_php.php file do the following change;

if(CAPTCHA_CONTACT_US != 'false')
```To this

if(CAPTCHA_ASK_A_QUESTION != 'false')

SET @configuration_group_id=0;
SELECT (@configuration_group_id:=configuration_group_id) FROM configuration_group WHERE configuration_group_title= 'CAPTCHA' LIMIT 1;

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES
(NULL, 'Ask A Question page', 'CAPTCHA_ASK_A_QUESTION', 'true', 'Activate Validation on Ask A Question page', @configuration_group_id, 23, NOW(), NULL, 'zen_cfg_select_option(array('true', 'false'),');

Dave
Always forward thinking... Lost my mind!

12 Sep 2008, 4:34 AM
#364
davewest avatar

davewest

Totally Zenned

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

Re: Captcha using TTF & GD

Jeff_Mash:

Thanks Dave. I will be anxiously awaiting your response. If you need me to verify anything, just let me know.

Jeff, Just noticed my image is now working for the create account page. The only thing I could trace back, I modified the phpBB code sections when I was working on the Nick Name mod. I'll have to run a trace this week end to see where it started to work..

Dave
Always forward thinking... Lost my mind!

12 Sep 2008, 10:28 PM
#365
romy avatar

romy

New Zenner

Join Date:
May 2007
Location:
york, pa
Posts:
98
Plugin Contributions:
0

Re: Captcha using TTF & GD

Hi, Did what you said. Now I get a blank pg. set pages to default..then worked. Tryed it again, made sure all codes in right place ..no luck. My guess is maybe missing a line of code.just a guess. view page http://elephat.net/elephat-davidson-p-2.html .Thanks

13 Sep 2008, 4:19 PM
#366
francocauter avatar

francocauter

Zen Follower

Join Date:
Jun 2007
Location:
Milton Keynes UK
Posts:
153
Plugin Contributions:
0

Re: Captcha using TTF & GD

Hi Davewest,
can you help me? I have the problem, the image does not show.
my story:
I made a back-up of the server files at https://www.livemk.co.uk, I uploaded the same set of files into a new server, done all the config.... but captcha image does not show, you can see it here: https://www.uk-classads.co.uk/captcha_test.php.
Obviously the test at https://www.livemk.co.uk works

can you give me any hints?

14 Sep 2008, 10:42 AM
#367
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: Captcha using TTF & GD

You can see the error - https://www.uk-classads.co.uk/captcha_img.php?zenid=e7192a88fdb9140890e769bd2c00c64e&rand=0.057221001221388468

You can:

Edit includes/classes/captcha.php.
Find

$this->img_href = zen_href_link('captcha_img.php', zen_session_name() . '=' . zen_session_id(), 'SSL', false, false, true);

Replace by

$this->img_href = zen_href_link('captcha_img.php', zen_session_name() . '=' . zen_session_id(), 'NONSSL', false, false, true);

or

Change Your hosting settings

NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

19 Sep 2008, 2:08 PM
#368
mydanilo avatar

mydanilo

Totally Zenned

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

Re: Captcha using TTF & GD

Installed this mod in another cart and I get again:

Enable this Picture and redraw button is showing but no Captch.

I can see and edit all the captcha options in my admin. No problem.

captcha_test.php renders the same Enable this Picture problem.

captcha_debug.php runs as well, shows a bunch of garbage and then some info:

captcha::__set_state(array(
'captchaCode' => 'DHPA',
'captchaCode_length' => '4',
'img_width' => '240',
'img_height' => '50',
'img_type' => 'png',
'chars_min_size' => '0.6',
'chars_max_size' => '0.8',
'chars_shadow' => true,
'chars_rotation' => '23',
'noise' => 30,
'backgroundColor' =>
array (
0 =>
array (
0 => 220,
1 => 220,
2 => 220,
),
1 =>
array (
0 => 255,
1 => 255,
2 => 255,
),
),
'linesColor' =>
array (
0 =>
array (
0 => 150,
1 => 150,
2 => 150,
),
1 =>
array (
0 => 185,
1 => 185,
2 => 185,
),
),
'textColor' =>
array (
0 =>
array (
0 => 30,
1 => 30,
2 => 30,
),
1 =>
array (
0 => 199,
1 => 199,
2 => 199,
),
),
'dir_fs_fonts' => '/xxxxxx/artwax/public_html/candlestore/fonts/',
'ttf_list' =>
array (
0 => '/xxxxxxx/artwax/public_html/candlestore/fonts/VERDANA.TTF',
),
'max_try' => 5,
'failure_proc' => '',
'quality' => 60,
'chars' =>
array (
0 => '1',
1 => '2',
2 => '3',
3 => '4',
4 => '5',
5 => '6',
6 => '7',
7 => '8',
8 => '9',
9 => 'A',
10 => 'B',
11 => 'C',
12 => 'D',
13 => 'E',
14 => 'F',
15 => 'G',
16 => 'H',
17 => 'I',
18 => 'J',
19 => 'K',
20 => 'L',
21 => 'M',
22 => 'N',
23 => 'O',
24 => 'P',
25 => 'Q',
26 => 'R',
27 => 'S',
28 => 'T',
29 => 'U',
30 => 'V',
31 => 'W',
32 => 'X',
33 => 'Y',
34 => 'Z',
),
'_background' => NULL,
'img' => NULL,
'_gd_version' =>
array (
'GD Version' => 'bundled (2.0.34 compatible)',
'FreeType Support' => true,
'FreeType Linkage' => 'with freetype',
'T1Lib Support' => false,
'GIF Read Support' => true,
'GIF Create Support' => true,
'JPG Support' => true,
'PNG Support' => true,
'WBMP Support' => true,
'XPM Support' => true,
'XBM Support' => true,
'JIS-mapped Japanese Font Support' => false,
'version' => '2',
),
'debug' => true,
'img_href' => 'https://www.artwax.com/candlestore/captcha_img.php?zenid=',
'imageColorFunc' => 'imagecolorallocate',
))

Any ideas what is wrong?

Live and learn... the Zen way.

22 Sep 2008, 4:45 AM
#369
zevink avatar

zevink

New Zenner

Join Date:
Dec 2007
Location:
Kingsville, TX
Posts:
19
Plugin Contributions:
0

Re: Captcha using TTF & GD

Giving this a as I am not getting the CAPTCHA to show in any page. In FF I get the same thing as **mydanilo **(above) and in IE I get a CAPTCHA pic. captcha_test.php works fine in both. I am unable to get it to view in the page.

Any ideas.

zen-cart- 1.3.7.1
php- 5.2.6
captcha- 2.8
www dot squirrelysliquor dot com

:bigups:

22 Sep 2008, 12:29 PM
#370
mydanilo avatar

mydanilo

Totally Zenned

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

Re: Captcha using TTF & GD

zevink, my problem is in IE as well as Firefox.

Live and learn... the Zen way.

25 Sep 2008, 10:30 PM
#371
mydanilo avatar

mydanilo

Totally Zenned

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

Re: Captcha using TTF & GD

Does nobody have a clue if the debug I posted has any meaning?

I don't know where to look. I think there must be another module that interferes with captcha. I am sure I uploaded the same files to this site as I did with my others. Same Zen 1.3.8a.
Different template but pretty much the same setup. So I wonder if anybody has discovered any conflicts with other mods or files in overrides etc. Really would like this to work. Too much spam coming in over the contact us.

Any hints are appreciated.

Live and learn... the Zen way.

26 Sep 2008, 2:57 AM
#372
zevink avatar

zevink

New Zenner

Join Date:
Dec 2007
Location:
Kingsville, TX
Posts:
19
Plugin Contributions:
0

Re: Captcha using TTF & GD

mydanilo, I know your pain. I've been going over my code for days now. I have read elsewhere that this mod is dead, no one is supporting it now.

With so many themes, mods, plug ins, etc. it get hard to figure out what the problem might be. Could this be a style sheet problem? Could it be a compatibility issue?

Problems like this make me what to go to the local community college and enroll.

I have looked at your sites in FF and IE. I even ran the debug. Have you tried to change the image type from png to jpeg or gif? Perhaps this could help with it not showing in the test. As for it not inserting into the contact us etc pages I have know idea and can't view your coding. That is why we are not getting any help. I think we need to hire someone to fix it for us. I am getting an ever increasing amount of SPAM as I feel the 'word' is out.

I would love to get this working.

26 Sep 2008, 12:02 PM
#373
mydanilo avatar

mydanilo

Totally Zenned

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

Re: Captcha using TTF & GD

I hear you. The captcha does insert in to the contact us once I enable it again but it only shows the

Enable this picture Redraw Capture Image
Verification code: * (case insensitive)

Just no captcha picture is showing up.

What gets me is that I installed the same thing on my other site and they are almost identical.:(

Live and learn... the Zen way.

26 Sep 2008, 5:42 PM
#374
romy avatar

romy

New Zenner

Join Date:
May 2007
Location:
york, pa
Posts:
98
Plugin Contributions:
0

Re: Captcha using TTF & GD

have captcha installed on my site elephat.net
http://elephat.net/logo-design-p-30.html..
click the contact up button..Now ...my problem is ..when you fill out the form you do not need to enter the captcha text. I want customers to have to fill in the captcha....How and what do I edit to make this work....Thanks

27 Sep 2008, 4:16 AM
#375
davewest avatar

davewest

Totally Zenned

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

Re: Captcha using TTF & GD

romy:

have captcha installed on my site elephat.net
click the contact up button..Now ...my problem is ..when you fill out the form you do not need to enter the captcha text. I want customers to have to fill in the captcha....How and what do I edit to make this work....Thanks

Check your \includes\modules\pages\contact_us\header_php.php

The code for checking the box is ether missing or missed placed.

// BOF Captcha
  if (is_object($captcha) && !$captcha->validateCaptchaCode()) {
    $error = true;
    $messageStack->add('contact', ERROR_CAPTCHA);
  }
//  if ($zc_validate_email and !empty($enquiry) and !empty($name)) {
  if ($zc_validate_email and !empty($enquiry) and !empty($name) and !$error) {
// EOF Captcha
```**mydanilo**, I ran the debug on my site and it reads the same as yours.  My Captcha works fine in IE and FX, I even used it on other pages that didn't come with the mod.   I don't use it with the account page... but it does work when I turn it on.  It started working on that page after I made edits to the phpBB code so I could allow users to use a nick name on the review pages and to create one during account creation.  I did some other edits during that time so I'm not sure that was it, and havn't been able to back trace it yet.

**zevink**, Andrew is still answering posts and updating it. *  I have read elsewhere that this mod is dead, no one is supporting it now.  *

As long as someone is willing to answer a question, or do some coding, it's alive.

Dave
Always forward thinking... Lost my mind!

27 Sep 2008, 6:47 AM
#376
romy avatar

romy

New Zenner

Join Date:
May 2007
Location:
york, pa
Posts:
98
Plugin Contributions:
0

Re: Captcha using TTF & GD

Help with Captcha combo....can fill out contact us form with out using captcha code..any ideas elephat.net

28 Sep 2008, 4:14 AM
#377
romy avatar

romy

New Zenner

Join Date:
May 2007
Location:
york, pa
Posts:
98
Plugin Contributions:
0

Re: Captcha using TTF & GD

can not get captcha to work - can fill out the contact form without entering the validation code...How would I get this to work elephat.net

29 Sep 2008, 5:29 PM
#378
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

Re: Captcha using TTF & GD

Have you checked to make sure that you have uploaded the captcha_img.php in the directory that your store is in?

For example, if your store is in the /cart directory - upload that file to that directory and it should work...

If that does not work, upload the captcha_debug.php file into the store directory and go to that url to see what is going on...

http://yourdomain/storedirectory/captcha_debug.php

Hope that helps!

mydanilo:

I hear you. The captcha does insert in to the contact us once I enable it again but it only shows the

Enable this picture Redraw Capture Image
Verification code: * (case insensitive)

Just no captcha picture is showing up.

What gets me is that I installed the same thing on my other site and they are almost identical.:(

29 Sep 2008, 9:10 PM
#379
mydanilo avatar

mydanilo

Totally Zenned

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

Re: Captcha using TTF & GD

Judy, already did that and posted a little back... you can have a look and see if my debug means anything to you. It is all there... don't know what other stuff could interfere with this.

Live and learn... the Zen way.

29 Sep 2008, 10:07 PM
#380
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

Re: Captcha using TTF & GD

I just installed this on a 1.3.8a zencart today - had the same problem until I double checked and realized the file I previously mentioned was not on there... so I uploaded it (while hitting myself in the head for not seeing it in the first place!! :oops:) and it worked fine as soon as that file was uploaded to the correct place. I was hoping that might be the case with you - since the end result was the same - no redraw picture.

I looked at your previous post and the info is a little different than what I have when I do the debug on the site.... it shows "var $" in places where yours just shows an '

I am pasting from my site here so you can compare the two - putting xxxxxxx to take out identifying info.

I am not a programmer... or code writer... or anything nearly that SMART :wink: ) but I am wondering if your version of zencart is not 1.38a or if the mod you are installing is not the one located here: http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=551

class captcha {
var $captchaCode = 'D9AVY';
var $captchaCode_length = '5';
var $img_width = '240';
var $img_height = '50';
var $img_type = 'png';
var $chars_min_size = '0.6';
var $chars_max_size = '0.8';
var $chars_shadow = false;
var $chars_rotation = '23';
var $noise = 30;
var $backgroundColor =
array (
0 =>
array (
0 => 220,
1 => 220,
2 => 220,
),
1 =>
array (
0 => 255,
1 => 255,
2 => 255,
),
);
var $linesColor =
array (
0 =>
array (
0 => 150,
1 => 150,
2 => 150,
),
1 =>
array (
0 => 185,
1 => 185,
2 => 185,
),
);
var $textColor =
array (
0 =>
array (
0 => 30,
1 => 30,
2 => 30,
),
1 =>
array (
0 => 199,
1 => 199,
2 => 199,
),
);
var $dir_fs_fonts = '/home/xxxxxxxx/public_html/cart/fonts/';
var $ttf_list =
array (
0 => '/home/xxxxxxxxx/public_html/cart/fonts/VERDANA.TTF',
);
var $max_try = 5;
var $failure_proc = '';
var $quality = 60;
var $chars =
array (
0 => '1',
1 => '2',
2 => '3',
3 => '4',
4 => '5',
5 => '6',
6 => '7',
7 => '8',
8 => '9',
9 => 'A',
10 => 'B',
11 => 'C',
12 => 'D',
13 => 'E',
14 => 'F',
15 => 'G',
16 => 'H',
17 => 'I',
18 => 'J',
19 => 'K',
20 => 'L',
21 => 'M',
22 => 'N',
23 => 'O',
24 => 'P',
25 => 'Q',
26 => 'R',
27 => 'S',
28 => 'T',
29 => 'U',
30 => 'V',
31 => 'W',
32 => 'X',
33 => 'Y',
34 => 'Z',
);
var $_background = NULL;
var $img = NULL;
var $_gd_version =
array (
'GD Version' => 'bundled (2.0.28 compatible)',
'FreeType Support' => true,
'FreeType Linkage' => 'with freetype',
'T1Lib Support' => false,
'GIF Read Support' => true,
'GIF Create Support' => true,
'JPG Support' => true,
'PNG Support' => true,
'WBMP Support' => true,
'XBM Support' => true,
'JIS-mapped Japanese Font Support' => false,
'version' => '2',
);
var $debug = true;
var $img_href = 'https://www.xxxxxxxxxx.com/cart/captcha_img.php?zenid=268fb4ba0561b86397201009602df1de';
var $imageColorFunc = 'imagecolorallocate';
}

mydanilo:

Judy, already did that and posted a little back... you can have a look and see if my debug means anything to you. It is all there... don't know what other stuff could interfere with this.