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.
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
Do u use mod rewrite? Set the / on the front paht of image file. May be it helps u.
Offline
Thanks! I added the / and the image displays now.
Offline
It's good. Does captcha work correctly?)
Offline
No, I still haven't got the right code for checking the captcha.
Offline
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
I can`t help because I don`t know what captcha you are using.
Offline
Dear Holly, did u fix it?
Offline
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
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.
Offline
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
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.
Offline
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
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..
}
Offline
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
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..
Offline
Yes, i worked ( hidden now ), but preview button doesn't works.. it still showing error message about missing captcha code:(
Offline
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
Not sure then, sorry. I don`t have a setup of Maian Greetings on my drive at the moment.
Offline
hope, u can get more little time to help me with that.. thanks..
Offline
Use the contact option and I`ll take a look for you.
Offline
Thanks, i have writen the letter already.
Offline
Hi:) Any good news, friend?)
Offline
Hi teze,
I haven`t received anything at the moment. Try the private message on this forum.
Offline
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