Home
About
Contact
Categories
Classic ASP (28 - Sub-Categories)
CSS (1 - Sub-Category)
JavaScript (4 - Sub-Categories)
Databases (22 - Sub-Categories)
ASP.NET (23 - Sub-Categories)
Delphi (5 - Sub-Categories)
Windows Server Core (3 - Sub-Categories)
VMWare (1 - Sub-Category)
Code Editing Tools (2 - Sub-Categories)
Linux (2 - Sub-Categories)
Dell Servers (15 - Sub-Categories)
Bug Reports
(Bugs Fixed
New CFFCS Coding Source is still in Beta
Please report any errors to the [Contact] page. Thank you.
Classic ASP (28)
CSS (1)
JavaScript (4)
Databases (22)
ASP.NET (23)
Delphi (5)
Windows Server Core (3)
VMWare (1)
Code Editing Tools (2)
Linux (2)
Dell Servers (15)
Resources
[View The Source Code For This Project]
Format SQL Script
Classic ASP
Forms
No Captcha ReCaptcha 2.0 with ASP Classic
Live Editing Disabled for Server-Side Example
HTML
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
Untitled Document
Name
<% 'You will need the new reCaptcha 2.0 Site Key for this. 'Go here: https://www.google.com/recaptcha/admin 'And add a new Site Key for your website. 'For local testing, you will have to test with 'local/site.asp '127.0.1/site.asp 'It will not work with a static IP Address as I would prefer. %>
JavaScript
ajaxsbmt.js
// JavaScript Document $(document).ready(function(responsediv){ $('form').submit(function(e){ e.preventDefault(); $.ajax({ // if you recieve // Form submission failed! // Make sure the URL path is correct! url: "3.asp", type: "POST", data: $(this).serialize(), success: function(data){ $(".postData").html(data); const string = data; const substring = "REDIRECT-TO:"; if (string.indexOf(substring) !== -1){ let text = data var getURL = text.replace("REDIRECT-TO:","") //console.log (text.replace("REDIRECT-TO:","")) window.location = getURL } //alert("Data: " + data + "\nStatus: " + status); }, error: function(){ //alert("Form submission failed!"); $(".postData").html("Form submission failed!") } }); }); });
Classic ASP
3.asp
<% 'Written by Wayne Barron of CFF Coding Source 'Carrz-Fox-Fire Promotions 2000-2015 'Credit to Shahid Shaikh https://codeforgeek.com/ 'For his response, that got me pointed in the right direction. ' 'Dated: Wednesday, January 21, 2015 'First we are going to grab our variables from our form. strname = request.Form("name") captcha = request.Form("g-recaptcha-response") 'Next, we are going to make sure that each form variable has a value (Meaning: Filled out) if strname = "" then response.Write "Please provide your name." 'next, we are going to challenge the reCaptcha, to make sure that it is not blank, 'and there is NO way around this. If it is not blank, then we send them a message. elseif captcha="" then response.Write "You have not completed the
reCAPTCHA
Please click on the blank box,
and fill in the sequence of characters.
Thank You" else ' If the user has completed the reCaptcha, we send a message letting them know. response.Write "Thank you for trying out the
ASP Classic / Jquery reCAPTCHA 2.0
demo." end if %>
Resources
(Copy JS and CSS code below, and add it to your project. It is best to download and host from within your site. This will reduce bandwidth drain from your hosting server and the servers hosting the actual files.)
https://www.google.com/recaptcha/api.js
Preview
Tags
No Captcha ReCaptcha 2.0 with ASP Classic
No Captcha ReCaptcha 2.0