Trying to enable CAPTCHA but cannot see the image??

0
August 17, 2011

Hi There,

I am trying to add a CAPTCHA to my web forms.

I am following the tutorial here:

http://www.boutell.com/new faq/creati ng/captcha .html

I have downloaded the captcha.zip file and added it to my server.

I have run the demo.php here:  

http://www.campsaustraliaw ide.com/ca ptcha/demo .php

you can hear the sound file, but I cannot see the image.

My GD library is enabled and you can view all the php settings here:

http://www.campsaustraliaw ide.com/in fo.php

When I right click on the missing image and try to view image I get this error:

Fatal error: Call to undefined function: imageantialias() in /home/9-web/97/19/campsaus

traliawide

.com/publi

c/www/capt

cha/captch

a.php on line 93

So I am not sure what to do now?  What am I missing?

13

answers

Comments See all(0)

Add comment
0
August 17, 2011

ahhh, well I guess they are still standard.

Anyway I am trying to use this one:

http://www.phpcaptcha.org/ download/

I had the email scripting in Perl but am going to change it to php.

I ran a test here

http://www.campsaustraliaw ide.com/te st.php

and got a positive result so I expect all my settings are ok.

If my solution works using phpcaptcha I will close this question.  While you all helped me to discover a solution I ended up using my own.  Not sure if I can award points for the efforts given that helped me get to my end result?

0
August 17, 2011

Although i cannot find the solution to your problem, I'll list 2 possible culprits,

GD uses memory, if the memory use is too high, it crashes your webpage. The only solution is to increase your script's memory.

You are using PHP 4, and that plugin maybe requires PHP 5

I would also like to add that every bot will easily dechipher those captchas. You should perhaps look at recaptcha (

http://recaptcha.net/

), or a captcha which at least has the letters or a same colored line bindind the letters so they look like they're touching each other.

0
August 17, 2011

Here is the very simple CAPTCHA script I have used with success.  Tho not as sophisticated as reCaptcha, it works out of the box and is very easy to implement.

HTH, ~Ray

<?php // CAPTCHA_NUMBER.PHP GENERATES A PICTURE OF A NUMBER
 $data = base64_decode($_GET['dt']);
 $im   = imagecreate(46,13);
 $bg   = imagecolorallocate($im, 255,255,255);
 $gray = imagecolorallocate($im, 188,188,188);
 $text = imagecolorallocate($im, 178,34,34);  // firebrick
 imagestring($im,5,4,0,$data,$text);
 imageline($im,4,12,38,0,$gray);
 imagepng($im);
 imagedestroy($im);
?>






<html> <!-- GOES IN THE FORM SCRIPT -->
Type <img style="display:inline;" src=captcha_number.php?dt=<?php $x = mt_rand(1000,10000); echo base64_encode($x);?> />
here: <input type=hidden name='_newMd5' value="<?=md5($x)?>" />  
<input name="_newCode" type="text" maxlength="64" size="6" autocomplete="off" />







<?php // GOES IN THE ACTION SCRIPT
$newCode = $_POST["_newCode"];
$newMd5  = $_POST["_newMd5"];
$newCode = md5($newCode);
if ($newCode != $newMd5)
{die('Security code number did not match');
}
0
August 17, 2011

Hi Ray,

Would you mind explaining how to add this briefly?

0
August 17, 2011

Sure, I'll try...

Lines 1 to 11 are a program you install on your server.  Lines 18 ~ 21 go into the form.  Lines 29 ~ 36 go into the action script that processes the form.

The form generates a random number, and the md5() code for the random number, and passes the md5() code into the POST array to the action script.  It passes the random number to the program, which draws the number on the browser window in the form.  The client types in the random number that is shown on the screen, and that goes into the POST array, too.

The action script takes the number the client typed, runs it through md5() and compares it to the md5 code for the original number in the form.

HTH, ~Ray

0
August 17, 2011

ok, so, Lines 1- 11, how do I install this on the server?  Do I create a new php file with this lines and then run it??

Sorry, I just need a little bit more clarification.

Here is an example of the page I need to add it on:

http://www.campsaustraliaw ide.com/in dex.php?pa ge=17

I have attached the FormMail.pl that is used to process the form.  Can you help me to show me where I need to add the last part of the code lines 29-36.  

Thanks

Attachments
0
August 17, 2011

Yes, just copy lines 1 - 11 into a file on your server named "captcha_number.php"  Put the HTML part into the page where the form is presented.  Sorry, I do not have time to work through 600+ lines of code in the formmail script.  The only advice I can give you about that is to put the test code somewhere near the top so that it gets executed unconditionally.

Best regards, ~Ray

0
August 17, 2011

Did you send me a form request at all.

5 minutes before you posted a response I recieved an email from one of these forms??

0
August 17, 2011

Ok, I don't mean to be stupid here, I just need a bit more direction.

The reason I posted the FormMail.pl was to make sure I can infact put your script into that file.

Can I?

0
August 17, 2011

Well I tried it anyway.

It didn't work.  The FormMail.pl came back with an error.

The image creator didn't really work either, the characters were not from the standard qwerty keyboard.

So I am back to square one now.

I would love to know how to fix the image problem from the beginning of this problem

0
August 17, 2011

Jack McCleod,

 you said, "The only solution is to increase your script's memory" and

"You are using PHP 4, and that plugin maybe requires PHP 5"

How can I fix these two things and test if its the problem.

I like recaptcha but I don't want the branding shown on the form so I would love to solve the first problem.

Plus, how I may encounter the same problem if I cant load up images?

0
August 17, 2011

You can increase script memory in your php.ini or in your code ini_set('memory_limit', '128M'); that should give your gd plenty of memory.

go here for other methods including the one i just gave you:

http://drupal.org/node/207 036

As for php5 or php4 it really depends on the script and what it uses, would be best to ask the author if it is php4 compatible, it probably is but its best to check.

ps: recaptcha without branding here:

http://recaptcha.net/fastc gi/demo/cu stomtheme

how to custom brand here:

http://recaptcha.net/apido cs/captcha /client.ht ml

Even the most secure captchas (yahoo's for example) have been broken, in my opinion, captchas keep users out, not spammers. So if there are no messages (forums) in your forms, i really dont see a reason for a captcha nowadays.

0
August 17, 2011

Very interesting captcha, if you make your own, make sure the characters used touch each other a bit, with a line of the same color somewhere through them, it makes it a lot harder on bots. As for the point thing, someone has done that in the past so it is possible, how he did that, i am not sure.

(probably by asking a mod to close and leave a points message, but dont fight with the site over it, it doesn't really matter much, its only a number, and its not like im aiming for a top score or anything. If they close an account for "lack of points" they lose someone that can provide answers, which is bad for them, and when a company does something bad for themselves, its a business opportunity for you to use the same model, and do it better :D.)

Related Questions

online form not working

We are using http://www.tectite.com/ for an online form on the below website: http://myrascakes.com/orde r.html We keep getting an error and don&#39;t know how to fix it. &#160;There is a r Read More

Views

818

Votes

0

Answers

15

August 15, 2011

This is the very first question

Hello guys! This is the first post in this site Read More

Views

2k

Votes

4

Answers

2

January 08, 2016

report values not showing up.

I have a crystal report which I pass a DataSet to using VB.NET. The report was working fine, but then I make some changes to the import query and now nothing shows up in the crystal report. Crystal do Read More

Views

1k

Votes

0

Answers

12

September 06, 2005

Event log doesn't overwrite as needed in SP4

Hello All, After upgrading from SP3 to SP4 on several Windows 2000 PRO machines everything looked fine, but from time to time applications can&#39;t write to the event log. When I try to view the appl Read More

Views

1k

Votes

0

Answers

9

May 11, 2003

"Failed to self-register XYZ.dll"

Hi there, I wrote a OLE-automation-server DLL in VB4.0. I use Installshield Express to install it as part of my program on the target computers. Now on some computers I get the message &quot;Failed to Read More

Views

2k

Votes

0

Answers

2

November 08, 1998

Please help understand these notes on image processing

Can someone please help me understand these lecture notes... On the right of the page; What does &quot;normalised by one notion of the area of a pixel&quot; mean? On the first formula for A, Is that a Read More

Views

1k

Votes

0

Answers

3

February 05, 2009

Can someone please explain this paragram on the chain rule in image processing

Please see the screenshot, How is 3133030 got from 10103322? Read More

Views

1k

Votes

0

Answers

1

January 05, 2009

AD on 2003

We have created an AD Domain on Windows 2000 Server with no problems. We just created an AD Domain on Windows 2003 and we&#39;re getting some weird problems. Both of these domains are behind firewalls Read More

Views

1k

Votes

0

Answers

15

May 11, 2003

ADDT ASP Upload Error " Type mismatch: 'tNG_isFileInsideBaseFolder' "

I am trying to create a simple insert record and upload image function on an ASP page built using Adobe Dreamweaver Developer Toolkit. I have done this many times before with no problem, however, i ha Read More

Views

1k

Votes

0

Answers

0

November 02, 2008

MYSQL Select query with custom ORDER BY

Hi, is it possible to customize the order of the returned rows in mysql? Example: I have a Table with a column &quot;name&quot;, now I want to have all entries ordered by name, but I want the entries Read More

Views

1k

Votes

0

Answers

5

July 02, 2010

Folder Redirection in Server 2003

We have a Windows Server 2003 Standard Ed. Is there a way to redirect the users my documents to a folder that has already been created on the server? Read More

Views

1k

Votes

0

Answers

2

July 05, 2007

Partiton magic  version 8.0 having error 1523 while executing batch

I followed the partition magic 8.0 wizard to partition my hard disk while rebooting &#160;I came across this problem &#160;&quot;error 1523 while executing batch&quot; What can I do to solve this prob Read More

Views

1k

Votes

0

Answers

2

May 11, 2003

Please explain this paragraph in image processing (screenshot attached)

Two questions; How is the equation (10.1-15) formed? &quot;are isotropic for rotation increments of 90 degrees and 45 degrees respectively&quot; What does this mean Read More

Views

770

Votes

0

Answers

7

January 05, 2009

xp_cmdshell with net use

Hi, when I use &#39;net use \192.168.0.1\c$ password /user:username&#39; at the command prompt, it works fine. &#160;But if i try to use it in sql with &quot; exec master..xp_cmdshell &#39;net use \19 Read More

Views

718

Votes

0

Answers

5

April 11, 2003

hp ux11

i have a hp ux11 server. and i edited the /etc/resolv.conf to use my win2003 server dns server. That went fine, however, I would like to go the other way and add an entry on my win2003 dns to resolve Read More

Views

410

Votes

0

Answers

3

October 12, 2009

Using an application over a LAN

I have written an application that needs to be used on a LAN. &#160;The application setup wizard takes care of registering everything on a single PC, but how do you go about writing a setup program th Read More

Views

358

Votes

0

Answers

9

August 07, 1998

Need subnet of 12 IPs.

Please, Can someone help me to create a subnet consisting of 12 IP&#39;s. Thanks.. Read More

Views

366

Votes

0

Answers

5

April 11, 2003

Drill down in a cross-tabl report

Hello, Would some experts to show me if it is possible to do drill-up or drill-down (or both) in a cross-tab report? I would also like to know if it is possible to control what fields to be displayed/ Read More

Views

294

Votes

0

Answers

0

September 06, 2005

Using RDO, Enterprise V Professional

We would like to use RDO on our project made up of 4 developers. Do we need to have a copy of Enterprise for each developer or is it possible to use Professional for those developers not writing the R Read More

Views

347

Votes

0

Answers

6

January 07, 1998

Can't Edit IIS Metabase.xml

We do this on every windows 2003 server and never had an issue. We cannot edit the IIS Metabase.xml We have stopped IIS and made change click save, no problem but it does not take the new information. Read More

Views

349

Votes

0

Answers

0

July 05, 2007