我有一个带有表单的页面,我正在使用reCaptcha验证。奇怪的是,它适用于所有borwsers,除了IE9(兼容模式关闭)。 我得到的错误是我插入的reCaptcha关键字虽然插入正确但是不正确。
下面请找到该页面的代码。有人可以帮忙吗?
<!--#include virtual="/template/top/keyvals.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!--[if lt IE 7 ]> <html xmlns="http://www.w3.org/1999/xhtml" class="ie6"><![endif]-->
<!--[if IE 7 ]> <html xmlns="http://www.w3.org/1999/xhtml" class="ie7"><![endif]-->
<!--[if IE 8 ]> <html xmlns="http://www.w3.org/1999/xhtml" class="ie8"><![endif]-->
<!--[if IE 9 ]> <html xmlns="http://www.w3.org/1999/xhtml" class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html xmlns="http://www.w3.org/1999/xhtml"> <!--<![endif]-->
<head>
<title>Request Information</title>
<link rel="stylesheet" href="/template-hardlinked/css/tableprop.css" type="text/css"/>
<style type="text/css">
<!--
.style1 {color: #0079C1}
-->
</style>
</head>
<body onload = "changeVal()" >
<%
IF request.Form.Count > 0 THEN
Dim recaptcha_confirm_text, VarString, objXmlHttp, ResponseString
' Function to test the recaptcha field
Function recaptcha_confirm(privatekey,rechallenge,reresponse)
VarString = _
"privatekey=" & privatekey & _
"&remoteip=" & Request.ServerVariables("REMOTE_ADDR") & _
"&challenge=" & rechallenge & _
"&response=" & reresponse
'Test the user input
Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objXmlHttp.open "POST", "http://api-verify.recaptcha.net/verify", False
objXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXmlHttp.send VarString
'Read the response
ResponseString = split(objXmlHttp.responseText, vblf)
Set objXmlHttp = Nothing
'Analyse the response
If ResponseString(0) = "true" then
'They answered correctly so set the confirmation variable to Correct
recaptcha_confirm_text= "Correct"
Else
'They answered incorrectly so leave the confirmation variable with the value from the second line of the response
recaptcha_confirm_text = ResponseString(1)
End If
End Function
'Call the Function
recaptcha_confirm privatekey,Request.Form("recaptcha_challenge_field"),Request.Form("recaptcha_response_field")
'Check response is correct and give relevant response
IF recaptcha_confirm_text = "Correct" Then
Server.Transfer("/index.asp")
Else
Response.write "<script>alert('Please enter the reCAPTCHA keyword correctly');</script>"
Response.AddHeader "REFRESH","1;URL=todelete.asp"
'incorrect response - put any additional text etc. that you want the user to see here before the response.end statement
Response.End
End If
Response.Write "<BR>"
Response.Write "<HR>"
Response.Write "<font face='arial' size='2'>The rest of the code for the page on a successful captcha goes here.<HR></font>"
End If
%>
<h1 class="blueHeader"> TEST</h1>
<p>
Testing.
</p>
<p>
<form method="post" action="todelete.asp" name="DownloadForm" id="DownloadForm">
<input type="hidden" name="ThankURL" value="/pages/thankyou.asp" />
First Name <span class="style3">*</span></td>
<input type="text" name="txtFirstName" size="25" maxlength="100"/>
Last Name <span class="style3">*</span>
<input type="text" name="txtLastName" size="25" maxlength="100"/>
Email <span class="style3">*</span></td>
<input type="text" name="txtEmail" size="25" maxlength="100" />
Company <span class="style3">*</span></td>
<input type="text" name="txtCompany" size="25" maxlength="100" />
Address
<input type="text" name="txtAddress" size="25" maxlength="100" />
City
<input type="text" name="txtCity" size="25" maxlength="100" />
Country:*
<select id="cmbCountries" name="cmbCountries"><option value="">Select</option>
<option value="">--------------------------------------------</option>
<option value="United States">United States</option>
<option value="United Kingdom">United Kingdom</option>
<option value="Canada">Canada</option>
<option value="Germany">Germany</option>
<option value="Netherlands">Netherlands</option>
<option value="Australia">Australia</option>
<option value="Zimbabwe">Zimbabwe</option></select>
<span id="cmbstateca">State (Canada):*</span>
<select id="cmbStateca" name="cmbState"><option value="">Select</option>
<option value="">--------------------------------------------</option>
<option value="AB">Alberta</option>
<option value="BC">British Columbia</option>
</select>
<span id="cmbaus">State/Territory:*</span>
<select id="cmbAus" name="cmbState"><option value="">Select</option>
<option value="">--------------------------------------------</option>
<option value="NSW">New South Wales </option>
<option value="ACT">Australian Capital Territory </option>
</select>
<span id="cmbcounty">County:*</span>
<select id="cmbCounty" name="cmbState"><option value="">Select</option>
<option value="">--------------------------------------------</option>
<option value="Aberdeen City">Aberdeen City</option>
<option value="Wrexham">Wrexham</option>
<option value="York">York</option>
</select>
<span id="cmbstate">State (U.S. only):</span>
<select id="cmbStateus" name="cmbState"><option value="" selected>Select</option>
<option value="">--------------------------------------------</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
</select>
Telephone <span class="style3">*</span>
<input type="text" name="txtPhone" size="25" maxlength="100" />
Job Function <span class="style3">*</span>
<select name="txtTitle" id="JobFunction">
<option selected="selected">Select an Job Function</option>
</option><option value="IT MGMT: Corporate IT Mgmt (CIO/CTO/VP/DIR) ">IT MGMT: Corporate IT Mgmt (CIO/CTO/VP/DIR)
</option><option value="IT MGMT: Departmental/Divisional IT Management ">IT MGMT: Departmental/Divisional IT Management
</select>
How many people are there in your organization? <span class="style3">*</span>
<select id="rblUsers" name="rblUsers">
<option value="" selected="selected">Select number of users</option>
<option value="">------------</option>
<option value="home user">Home user</option>
Additional Comments <span class="style3">*</span>
<textarea name="txtNotes" style="width:288px;" cols="64" rows="5" ></textarea>
Enter the reCAPTCHA words <strong> <span class="style1">*</span></strong>
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'custom'
};
</script>
<div id="recaptcha_container">
<label for="recaptcha_response_field"></label>
<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" class="text" /><br /><br />
<div id="recaptcha_image"></div>
<p>Change the reCaptcha <a href="javascript:Recaptcha.switch_type('image');">image</a> or listen to the reCaptcha <br />
words as <a href="javascript:Recaptcha.switch_type('audio');">audio</a> </p>
<input type="button" id="recaptcha_reload_btn" value="Get new words" onclick="Recaptcha.reload();" />
</div>
<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LdYMMcSAAAAAKta499QQm49jJeAt4CasSpUxV_q">
</script>
<noscript>
<iframe src="http://api.recaptcha.net/noscript?k=6LdYMMcSAAAAAKta499QQm49jJeAt4CasSpUxV_q" height="300" width="500" frameborder="0"></iframe>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
</noscript>
<input type="hidden" id="MemberCountryOptInchkbox" class="hiddenf" name="MemberCountryOptIn" value="" style="width:20px;" >
<input name="MemberCountryOptIn" type="checkbox" class="show" id="MemberCountryOptInchkbox" value="" style="width:20px;" >
Yes, I would like to receive email communications
<br />
<input type="submit" value="Submit" onClick="javascript:return gfiDownloadValidate();" class="button last">
</form>
</body>
</html>