php - recaptcha integration with separate pages -
i trying add captcha website , trying thank open in different page instead of using php within same file, how go doing this?
i understand section of php surrounding form don't know how change send separate thank page.
edit - if add action page captcha breaks form submits , when take action out captcha works not submit
<!doctype html> <?php // grab recaptcha library require_once "recaptchalib.php"; // secret key $secret = "my secret key"; // empty response $response = null; // check secret key $recaptcha = new recaptcha($secret); // if submitted check response if ($_post["g-recaptcha-response"]) { $response = $recaptcha->verifyresponse( $_server["remote_addr"], $_post["g-recaptcha-response"] ); } ?> <html lang="en"> <head> <!--js--> <script src='https://www.google.com/recaptcha/api.js'></script> <title>mata captcha test</title> </head> <body> <?php if ($response != null && $response->success) { echo "hi " . $_post["name"] . " (" . $_post["email"] . "), submitting form!"; } else { ?> <form action="" method="post"> <label for="name">name:</label> <input name="name" required><br /> <label for="email">email:</label> <input name="email" type="email" required><br /> <div class="g-recaptcha" data-sitekey="my key"></div> <input type="submit" value="submit" /> </form> <?php } ?> </body> </html>
is mean?
<form action="insert_your_site_here.php" method="post">
instead of
<form action="" method="post">
Comments
Post a Comment