I get "Notice: Undefined index:" using example-captcha.php

2,715 views
Skip to first unread message

Wires001

unread,
Jan 22, 2009, 12:04:24 AM1/22/09
to reCAPTCHA
I tried plugging the reCAPTCHA code into my form, next I created a
form using the example code in the instructions and then I ran example-
captcha.php - all fail on the same line that begins with:

if ($_POST["submit"]) { etc. for the test form using the example code
http://triadgolf.com/reCAPTCHA/test.php

or

if ($_POST["recaptcha_response_field"]) { etc. for example-captcha.php
http://triadgolf.com/reCAPTCHA/example-captcha.php

Here is a link that shows how PHP is set up on my server
http://interdyne.com/test.php

Can anyone suggest what I might need to do?

Thanks

Tom Esker

Lesley Binks

unread,
Jan 22, 2009, 6:14:46 AM1/22/09
to reca...@googlegroups.com
Undefined index means what it says - the "submit" and
"recaptcha_response_field" are undefined in your $_POST array.

Check the value of your submit button and use that instead of
"submit". If it hasn't got one use value="submit" .
Then review your code against the examples and especially consider how
you are displaying the captcha from recaptcha.net in your form.

Regards

Lesley



2009/1/22 Wires001 <tes...@interdyne.com>:

Wires001

unread,
Jan 22, 2009, 6:57:29 AM1/22/09
to reCAPTCHA
Thanks for your reply. I took the example code from http://recaptcha.net/plugins/php/
and added my public and private keys with no other changes. This page
is at http://triadgolf.com/reCAPTCHA/test.php. It has "submit" in
both places:

if ($_POST["submit"]) {

and

<input type="submit" name="submit" value="submit" />

and I still get the error mesage:

Notice: Undefined index: submit

Any other suggestions?
> > Tom Esker- Hide quoted text -
>
> - Show quoted text -

Charles Sweeney

unread,
Feb 3, 2009, 6:40:19 AM2/3/09
to reCAPTCHA


Wires001 wrote:

> and I still get the error mesage:
>
> Notice: Undefined index: submit
>
> Any other suggestions?

That's not an error, it's a notice. Without seeing your code, how on
earth can anyone fix it for you...by guessing at your code??

You can make the notice go away by putting this line at the top of
your PHP script:

error_reporting(E_ALL ^ E_NOTICE);

--
Charles Sweeney
http://FormToEmail.com
PHP mail script with reCAPTCHA



Reply all
Reply to author
Forward
0 new messages