OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

PHP captcha problem

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> PHP captcha problem
Page: [1]
 
craigj1303

 

Posts: 46
Joined: 5/16/2007
Status: offline

 
PHP captcha problem - 3/27/2009 9:58:18   
Open Source PHP Captcha problem
I have been receiving copious amounts of SPAM through my "request a quote" form. Having investigated prevention techniques I found an Open Source PHP Captcha solution at www.phpcaptcha.org. I followed the instructions and implemented in to my code but although the captcha image is visible I am still able to submit the form without entering anything. The form also still submits when I deliberately enter a completely incorrect code!

My request a quote form can be found at http://www.digitalcolours.co.uk/estimator.html
I have uploaded the code I am using for you to view simply in txt format here:

http://www.digitalcolours.co.uk/estimatorhtml.txt
http://www.digitalcolours.co.uk/estimator.txt

If anyone can see any reason why the captcha isn't working please let me know. I have left a message on the board of the open source site but nothing has been updated on there since Aug 2008 so unsure whether I will receive a reply.

Alternatively, if anyone has any "simple" way to implement a protection for my form from Spambots I would appreciate it if you can let me know!

Thanks & Rgs

Craig
Tailslide

 

Posts: 6692
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: PHP captcha problem - 3/27/2009 11:41:32   
Hmmm.... I'm not a PHP expert but it looks like the form's being executed before it checks for the captcha.

I'd move that up above the mail bit and have it as an if {captcha stuff } else { mail stuff }.

Alternatively - you could probably tweak my form to do what you want (adding the extra fields). It uses a question instead of captcha for accessibility reasons plus a honeytrap input plus it checks headers to prevent injection attacks plus it generates a unique token and matches that to the one in the form. I haven't had a single form spam since I started using it.

You can either have the errors spit out at the top or next to the labels - currently it's a bit of a mix of the two - it repeats the empty field errors next to the label and the incorrect question error above the form.

Attachment (1)

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to craigj1303)
craigj1303

 

Posts: 46
Joined: 5/16/2007
Status: offline

 
RE: PHP captcha problem - 4/1/2009 13:31:16   
I like the look of your protection Tailslide, the trouble is that I am no expert on PHP either. I downloaded your contactform.txt file and had a look.

The way my form works is that I have the form contained in a .html page which when submitted goes to a .php page for processing. I don't understand why you have all that PHP in the same page as your contact form when the action script is in a seperate file called contact-form.php?

When I look at the source code from your contact page the form action is contactform.html. I also thought the action had to be a php file?

(in reply to Tailslide)
Tailslide

 

Posts: 6692
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: PHP captcha problem - 4/1/2009 13:37:49   
It processes the lot on the same page - no need for another page. Once processed sucessfully it goes to /thanks.html (in this case - just change as appropriate).

Just change the stuff around the form - the rest of the page e.g. the head section etc.

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to craigj1303)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> PHP captcha problem
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts