PDA

View Full Version : Captcha Not Showing Help with Website


spazzer
12-14-2010, 09:30 PM
Hi All,
I have had a bash at designing a website to promote my part time hobby, I have a problem with the reCaptcha on my form, I've entered keys etc but for some reason its not working, I get this error message on my website's page on the contact page http://www.nixwebdesign.co.uk/contact/contact.php (http://http://www.nixwebdesign.co.uk/contact/contact.php)

I followed Corrosive's Tutorial (http://corrosiveonline.co.uk/tutorials_enquiry_form_with_recaptcha.php) on it and created error.php and thanks.php pages for this !

Warning: require_once(recaptchalib.php) [function.require-once (http://www.nixwebdesign.co.uk/contact/function.require-once)]: failed to open stream: No such file or directory in /home/eustonfi/public_html/nixwebdesign.co.uk/contact/contact.php on line 66

Fatal error: require_once() [function.require (http://www.nixwebdesign.co.uk/contact/function.require)]: Failed opening required 'recaptchalib.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eustonfi/public_html/nixwebdesign.co.uk/contact/contact.php on line 66

Can Anyone take a look and maybe advise on hats not right ?
Its not the best site in the world but will do for now !!!

Cheers,
Nick C

spazzer
12-14-2010, 09:49 PM
Hi,
Have now got the recaptcha on the form but its not showing correctly can anyone assist ?

I moved the recaptchalib.php into contact folder !!!!

Cheers, Nick C

edbr
12-15-2010, 02:19 AM
its showing fo me but submit isnt, try closing the input fields
/>

edit sorry yes it is

spazzer
12-15-2010, 07:21 AM
Hi,
Thanks for reply, it is showing but it's not displaying correctly, which input fields do you mean ?

Cheers, nick c

edbr
12-15-2010, 07:25 AM
in the form fields , but how is it not displaying correctly?

spazzer
12-15-2010, 07:28 AM
Hi edbr,
It looks like there is a black line running through the reCaptcha box and it just looks distorted the box ? Is the reCaptcha box showing correctly for you ?

spazzer
12-15-2010, 07:33 AM
Hi,
I have checked the page now and it looks like where the black space runs through the recatcha box the image needs to move up then the box will show correctly, where do I close the tags you say in the form fields ?, does the reCaptcha box need to be in a div ?

Thanks NC

spazzer
12-15-2010, 07:38 AM
Have I put the snippet of Php code just before the submit button correctly ?

Thanks for help !

Nick C

edbr
12-15-2010, 08:01 AM
ah see what you mean . code shows three table cells so i would sugest it is the td class that is the problem . divs over tables any day of the week for me

edbr
12-15-2010, 08:02 AM
oh the input fields
Result: 0 errors / 7 warnings

line 57 column 14 - Warning: <input> element not empty or not closed
line 60 column 14 - Warning: <input> element not empty or not closed
line 120 column 93 - Warning: <img> element not empty or not closed
line 122 column 46 - Warning: unescaped & which should be written as &amp;
line 159 column 1 - Warning: discarding unexpected </div>
line 30 column 3 - Warning: <h1> proprietary attribute "name"
line 31 column 7 - Warning: <p> proprietary attribute "name"
ff validator

Corrosive
12-15-2010, 08:32 AM
There must be a conflict in styles there somewhere. I've never had that problem with ReCaptcha.

spazzer
12-15-2010, 08:33 AM
Hi ebr,
What does that mean ?,can you explain what I need to do ?

Cheers,
Nick C

spazzer
12-15-2010, 08:39 AM
Hi Corrosive,
Yes I Agree it could be a problem with a css style somewhere. When I see the CSS that is affecting the php the line height is set to 150% set in the p,dl, would this be affecting the capthcha box possibly, I have tried wrapping the captcha php in a div and then applying line height normal to the div but no joy !

Firstly can you see if I have the php code in the right place on the form please and should I maybe wrap it in a div ?

Nick C

spazzer
12-15-2010, 11:19 AM
Hi Guys,
Still cant get this to work, does anyone have any other ideas I can try ?, think may have to bin this idea !, shame as thought would be ok !

Cheers,
Nick C ;-)

Corrosive
12-15-2010, 11:23 AM
Just view > source on the page with the capture, see what tags it uses and then search your CSS for conflicts.

spazzer
12-15-2010, 11:40 AM
Hi Corrosive,
I have placed cursor in PHP code and then viewed the css styles affecting it, the only styles I can see affecting it are as below, do you think any of these may be the problem ?

text align left; found in css rule for #wrap
padding 10px; found in css rule for p,dl
font size 1.3 em; found in css rule for p,dl
line height 150%; found in css rule for p,dl

Thanks for help :confused:

Corrosive
12-15-2010, 05:02 PM
Hi Nick

I've had a look at this in FF and it seems to be your generic table styles (around line 171) that are doing this.

spazzer
12-16-2010, 10:24 AM
Hi Corrosive,
I have re-done the reCaptcha here:

http://nixwebdesign.co.uk/contact/contact.php

and have now got it working I think, the problem I have now is that the form isnt being sent for some reason, I followed your tutorial on inserting the php etc but can't seem to get the form sent to my e-mail all I get is a white screen when I click submit !

Can you help maybe ?

Cheers, Nick C

spazzer
12-16-2010, 11:10 AM
Hi,
I have placed this code in my mailer.php file, is it correctly filled out ?

<?php
require_once('recaptchalib.php');
$privatekey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if(!$resp->is_valid) {
header("location:error.php");
die();
}
//these are the form results
$name = $_POST['name'];
$email = $_POST['email'];
$enquiry = $_POST['enquiry'];
$formsub = $_POST['Submit'];

if($formsub){

//this creates the body of the mail message
$mailMessage = "The message is: Hi Nik. You have a message from Nix Web Design";
$mailMessage .= "Name:" .$name."\n\n";
$mailMessage .= "E-Mail:" .$email."\n\n";
$mailMessage .= "Enquiry:" .$enquiry."\n\n";
$header = "From: nik@nixwebdesign.co.uk\r\n";
$header .= "Reply-To: nik@nixwebdesign.co.uk\r\n";
$header .= "Return-Path: nik@nixwebdesign.co.uk\r\n";
mail('nik@nixwebdesign.co.uk', 'Website Enquiry', $mailMessage,$header);

header("location:thanks.php");
exit;

}
?>

Thanks Nick C