Skip to content
Advertisement

Recaptcha v2 not validating in PHP

I am trying to validate google recaptcha V2 in my PHP application registration form. But its not getting validated. Its giving a success message and its redirecting to the login page. Can someone please help me on this.

The HTML is as follows:

JavaScript

The AJAX is as follows:

JavaScript

This is the PHP Page where its Validating the POST.

JavaScript

Now the issue is its validating correctly. But If the validation is correct then it has to redirect to “top.location.href = “index.php?msg=login”;”. But its not redirecting.

Advertisement

Answer

Updated Code

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement