Php Google recaptcha ASP上的一页(经典)
我现在在ASP工作。我喜欢用PHP编程,但我的公司在他们的网站上使用ASP。在我的公司网站上,有一个表单连接到我们的CRM,关于发布的许多垃圾邮件,我们需要将Google recaptcha添加到表单中 下面是我在开发的许多网站上使用的recaptcha的PHP代码,在ASP上有可能有类似的方法吗?我只需要一页Php Google recaptcha ASP上的一页(经典),php,asp.net,recaptcha,Php,Asp.net,Recaptcha,我现在在ASP工作。我喜欢用PHP编程,但我的公司在他们的网站上使用ASP。在我的公司网站上,有一个表单连接到我们的CRM,关于发布的许多垃圾邮件,我们需要将Google recaptcha添加到表单中 下面是我在开发的许多网站上使用的recaptcha的PHP代码,在ASP上有可能有类似的方法吗?我只需要一页 <?php if(isset($_POST['submit'])): if(isset($_POST['g-recaptcha-response']) && !
<?php
if(isset($_POST['submit'])):
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha- response'])):
//your site secret key
$secret = '6Le5ohYUAAAAAAWeXQ4TnEMsOrW7wSw4WcNUVyS7';
//get verify response data
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
$responseData = json_decode($verifyResponse);
if($responseData->success):
$succMsg = 'Your contact request have submitted successfully.';
else:
$errMsg = 'Robot verification failed, please try again.';
endif;
else:
$errMsg = 'Please click on the reCAPTCHA box.';
endif;
else:
$errMsg = '';
$succMsg = '';
endif;
?>
<html>
<head>
<title>Google reCAPTCHA</title>
<script src="https://www.google.com/recaptcha/api.js" async defer> </script>
</head>
<body>
<div class="registration">
<h2>Contact Form</h2>
<?php if(!empty($errMsg)): ?><div class="errMsg"><?php echo $errMsg; ?></div><?php endif; ?>
<?php if(!empty($succMsg)): ?><div class="succMsg"><?php echo $succMsg; ?></div><?php endif; ?>
<div class="form-info">
<form action="" method="POST">
<input type="text" class="text" value="<?php echo !empty($name)?$name:''; ?>" placeholder="Your full name" name="name" >
<input type="text" class="text" value="<?php echo !empty($email)?$email:''; ?>" placeholder="Email adress" name="email" >
<input type="text" placeholder="Message..." name="message"><?php echo !empty($message)?$message:''; ?></textarea>
<div class="g-recaptcha" data-sitekey="6Le5ohYUAAAAAPDz2w2tDQ-3AgYwgEQmkOhnwYhO"></div>
<input type="submit" name="submit" value="SUBMIT">
</form>
</div>
<div class="clear"> </div>
</div>
</body>
</html>
谷歌雷帕查
联系方式
是的,您可以将Google recaotcha与Clasic ASP一起使用。你可以在这里看到他们的资料
我投票结束这个问题,因为StackOverflow不是一个免费的代码编写服务。