Maian Script World on Facebook Maian Script World on Twitter Maian Script World - Latest News Maian Script World on YouTube Maian Script World on LinkedIn


Please Read

You are required to register before you can post. This is via a custom verification system. Please post any problems you are encountering here and I`ll do my best to respond as soon as I can. Please note that a reply WILL be posted to all queries, so do not double post. There are no guarantees when a reply will appear but I do my best to answer all within 3/4 days max. Bumping topics won`t make the slightest difference.

IMPORTANT: Posts in English ONLY please, thank you! Any other languages will be ignored and your message deleted.
SEARCH: Use the search option to see if your question has been answered on the forum before. Or check the relevant script docs.
CUSTOMER: If you have purchased a commercial version of any of my software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
PRIVATE MESSAGES: Private messages are currently disabled.
LINKS: Any links posted are 'NOFOLLOW' and will not be picked up by search engines.

You are not logged in.

#1 20-10-2010 15:47:16

hollymh4
Members
Registered: 20-10-2010
Posts: 7

Installing Captcha

Hello,

I am trying to put in a captcha on the ecard.tpl.php page. I have a captcha.php file and I have put the following into the  ecard.tpl.php page before the preview button.

<img src="captcha.php" />
<input type="text" name="userpass" value="" />

Now I am stuck because I am not sure what code to use or in what file to check the captcha. I was thinking maybe class_sendcard.inc.php?

And the code might be something like this? Except I want the error message to appear on the current page rather than going to a blank page with that message.

function checkcaptcha() {
            session_start();
            if ($_SESSION["pass"] != $_POST["userpass"]) {
                die("Sorry, you failed the CAPTCHA. Note that the CAPTCHA is case-sensitive. Please hit your browser back button and try again.");
                return 1;
            }
        }


Also, my captcha image is not displaying. I have the captcha.php in the templates folder. Should it be somewhere else?


Thanks for any help you can give!

Offline

#2 20-10-2010 16:31:20

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

Do u use mod rewrite? Set the / on the front paht of image file. May be it helps u.

Offline

#3 20-10-2010 17:46:43

hollymh4
Members
Registered: 20-10-2010
Posts: 7

Re: Installing Captcha

Thanks! I added the / and the image displays now.

Offline

#4 21-10-2010 05:54:49

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

It's good. Does captcha work correctly?)

Offline

#5 21-10-2010 15:45:35

hollymh4
Members
Registered: 20-10-2010
Posts: 7

Re: Installing Captcha

No, I still haven't got the right code for checking the captcha.

Offline

#6 22-10-2010 20:16:27

hollymh4
Members
Registered: 20-10-2010
Posts: 7

Re: Installing Captcha

Anyone?

I just need to know how to check the captcha before the ecard previews/sends. I'm pretty sure the code will go in either class_sendcard.inc.php or class.phpmailer.php. I've tried a few things but they have not worked.

Thanks for your help!

Offline

#7 23-10-2010 05:46:53

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,124

Re: Installing Captcha

I can`t help because I don`t know what captcha you are using.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#8 26-10-2010 07:29:42

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

Dear Holly, did u fix it?

Offline

#9 16-11-2010 20:52:52

bphupscher
Members
From: Netherlands
Registered: 06-09-2008
Posts: 12

Re: Installing Captcha

Can someone who has a captcha working on the ecards, explain what to do, where to do it?

I would really like a captcha on the cards that can be send without a login.

I am not to much into php. have made some changes to my site though,

I can get a captcha code displayed in the template on only non-login-pages if I want to, but I cannot figure out, how to get the verification to work.

I tried http://www.phpcaptcha.org/documentation/quickstart/
See example http://www.de-digitale-bemoediging.nl/ecard110.html   

I also am still wishing there was a new version now... even if it would be a paid version (if not too expensive).
Thanks,
Bernhard

Offline

#10 17-11-2010 08:20:44

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,124

Re: Installing Captcha

Find the following code in the main index.php file around line 2382:

if ($comments=='')
         {
           $error_string[] = $msg_ecard41;
         }

AFTER that add:

if ($securimage->check($_POST['captcha_code']) == false) {
  $error_string[] = 'Incorrect captcha, please try again';
}

Make sure the $securimage variable matches your own. That should work ok.

There won`t be any new versions of Maian Greetings for a very long time. Sorry.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#11 31-12-2010 15:12:22

bakgrunder
Members
Registered: 31-12-2010
Posts: 1

Re: Installing Captcha

I testing this Captcha http://www.phpcaptcha.org/documentation/quickstart/

Where should I put this code?

include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';

$securimage = new Securimage();

On my test page, it shows only a white page. When you preview the card.

Offline

#12 03-01-2011 09:13:59

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,124

Re: Installing Captcha

In the main index.php file around line 2382 you`ll see:

if ($comments=='')
         {
           $error_string[] = $msg_ecard41;
         }

So, before or after that, you`ll need:

include_once 'securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
  $error_string[] = 'The code you entered was incorrect.  Go back and try again.';
}

This assumes you have the captcha code in a 'secureimage' folder and also that your form box is named 'captcha_code'.

Hope that helps.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#13 10-02-2011 07:46:12

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

Yeeah, thant helps, it works..

But, i have some question.

How to show capchta code AFTER preview step? Before send..

At now, i have captcha code before preview, and after click on preview, i show another capchta image, and that don't respond on that page and send button is work without captcha code. How to view and set captcha code to SEND button, after preview ( preview without captha) ?

Or.. check captcha code at once with preview page.., and in preview page hide captcha (as alreade passed stage)

Offline

#14 10-02-2011 08:31:27

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,124

Re: Installing Captcha

Hide it on preview is probably best. So, in the ecard template where you have the captcha,wrap it in an if statement:

if (!isset($_POST['preview'])) {
// show captcha..
}


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#15 11-02-2011 12:40:11

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

doesn't work(

Parse error: syntax error, unexpected '<' in Z:\home\google.com\templates\ecard.tpl.php on line 65


some html codes..
<?
if (!isset($_POST['preview']))
{
captcha html code bla bla bla..
}
another codes and buttons..

Offline

#16 12-02-2011 06:46:03

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,124

Re: Installing Captcha

teze wrote:

doesn't work(

Parse error: syntax error, unexpected '<' in Z:\home\google.com\templates\ecard.tpl.php on line 65


some html codes..
<?
if (!isset($_POST['preview']))
{
captcha html code bla bla bla..
}
another codes and buttons..

You have to break out of PHP mode.

<?php
if (!isset($_POST['preview']))  {
?>
captcha html code bla bla bla..
<?php
}
?>
another codes and buttons..


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#17 14-02-2011 11:10:13

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

Yes, i worked ( hidden now ), but preview button doesn't works.. it still showing error message about missing captcha code:(

Offline

#18 14-02-2011 11:30:03

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

in index.php

 if ($comments=='')
{
$error_string[] = $msg_ecard41;
}

include_once 'secureimage/securimage.php';
 $securimage = new Securimage();
  if ($securimage->check($_POST['code']) == false) {
 $error_string[] = 'The code you entered was incorrect.  Go back and try again.';
}

in ecard.tpl

 <?php
if (isset($_POST['preview']))  {
?>
captcha html code bla bla bla..
<?php
}
?>
another codes and buttons..

I use only isset, but not !issed. Second version ( with ! ) doesn't works.

Offline

#19 15-02-2011 06:23:00

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,124

Re: Installing Captcha

Not sure then, sorry. I don`t have a setup of Maian Greetings on my drive at the moment.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#20 16-02-2011 07:47:23

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

hope, u can get more little time to help me with that.. thanks..

Offline

#21 16-02-2011 08:59:11

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,124

Re: Installing Captcha

Use the contact option and I`ll take a look for you.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#22 17-02-2011 06:40:16

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

Thanks, i have writen the letter already.

Offline

#23 19-02-2011 10:06:23

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

Hi:) Any good news, friend?)

Offline

#24 19-02-2011 15:05:16

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,124

Re: Installing Captcha

Hi teze,

I haven`t received anything at the moment. Try the private message on this forum.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#25 21-02-2011 06:09:39

teze
Members
From: Moscow never sleep
Registered: 23-05-2009
Posts: 80

Re: Installing Captcha

Oh, i sent it from "Contact me" menu on header of site)
I dont found private message on forum, i think it disabled)), but i have written from contact link from user profile page once again

Offline

Board footer

2Checkout.com is an authorized reseller of goods and services provided by Maian Script World.© 2003-2013 David Ian Bennett. All Rights Reserved | Forum: FluxBB

Privacy Policy | Refund Policy