<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>leinadium &#187; webservice</title>
	<atom:link href="http://www.leinadium.com/tag/webservice/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leinadium.com</link>
	<description>Techhead. Codewarrior. Legalnerd.</description>
	<lastBuildDate>Fri, 02 Sep 2011 20:09:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>re captcha for classic asp in vbscript</title>
		<link>http://www.leinadium.com/code/re-captcha-for-classic-asp-in-vbscript/</link>
		<comments>http://www.leinadium.com/code/re-captcha-for-classic-asp-in-vbscript/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 10:52:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[recaptcha]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://217.11.59.22/leinadium/?p=21</guid>
		<description><![CDATA[If you&#8217;d like to use recaptcha on your classic asp pages, you&#8217;ll likely find this post http://groups.google.com/group/recaptcha/msg/187b6f7a32f4cbe4 in google groups interesting. Recaptcha, as you may well know, is the project by Carnegie Mellon University that is using the millions of CAPTCHA inputs on websites to digitize books. In fact, it is using human procesing power [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;d like to use recaptcha on your <strong style="color: black; background-color: #ff9999;">classic</strong> <strong style="color: black; background-color: #ff66ff;">asp</strong> pages, you&#8217;ll likely find this post http://groups.google.com/group/recaptcha/msg/187b6f7a32f4cbe4 in google groups interesting.<br />
Recaptcha, as you may well know, is the project by Carnegie Mellon University that is using the millions of CAPTCHA inputs on websites to digitize books. In fact, it is using human procesing power to digitize those parts that OCR software is having trouble with.<br />
Great Idea!<br />
So, on to making it work with <strong style="color: black; background-color: #ff66ff;">asp</strong>:</p>
<p><span style="font-family: courier new;"> Response.Write recaptcha_challenge_writer(publickey12)</span><br />
<span style="font-family: courier new;">If Request.ServerVariables(&#8220;CONTENT_LENGTH&#8221;) &lt;&gt; 0 Then</span><br />
<span style="font-family: courier new;"> Dim strReturn</span><br />
<span style="font-family: courier new;"> strReturn = recaptcha_confirm(privatekey12,Request.Form(&#8220;recaptcha_challenge_field&#8221;),Request.Form(&#8220;recaptcha_response_field&#8221;))</span><br />
<span style="font-family: courier new;"> If strReturn &lt;&gt; TRUE Then</span><br />
<span style="font-family: courier new;"> Response.Write  strReturn</span><br />
<span style="font-family: courier new;"> Else</span><br />
<span style="font-family: courier new;"> Response.Write &#8220;all ok&#8221;</span><br />
<span style="font-family: courier new;"> END IF</span><br />
<span style="font-family: courier new;">END If</span></p>
<p><span style="font-family: courier new;">&#8216; returns string the can be written where you would like the reCAPTCHA challenged placed on your page</span><br />
<span style="font-family: courier new;">function recaptcha_challenge_writer(publickey)</span><br />
<span style="font-family: courier new;"> Dim str</span><br />
<span style="font-family: courier new;"> </span><br />
<span style="font-family: courier new;"> str = &#8220;<script>var RecaptchaOptions = {theme : 'white',   tabindex : 0};</script><script>&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    str = str &amp;amp; " src=""http://api.recaptcha.net/challenge?k="&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    str = str &amp;amp; publickey &amp;amp; """&gt;</script><noscript>&lt;iframe&gt;&lt;br /&gt;&lt;span style=&#8221;font-family:courier new;&#8221;&gt; str = str &amp;amp; &#8221; src=&#8221;"http://api.recaptcha.net/noscript?k=&#8221; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#8221;font-family:courier new;&#8221;&gt; str = str &amp;amp; publickey &amp;amp; &#8220;&#8221;" frameborder=&#8221;"1&#8243;&#8221;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;textarea name=&#8221;" rows=&#8221;" cols=&#8221;"&gt;&lt;/textarea&gt;&lt;input type=&#8221;" name=&#8221;" value=&#8221;"&gt;</noscript>&#8220;</span><br />
<span style="font-family: courier new;"> recaptcha_challenge_writer = str</span><br />
<span style="font-family: courier new;">end function </span></p>
<p><span style="font-family: courier new;">function recaptcha_confirm(privkey,rechallenge,reresponse)</span><br />
<span style="font-family: courier new;"> &#8216; Test the captcha field</span><br />
<span style="font-family: courier new;"> Dim VarString</span><br />
<span style="font-family: courier new;"> VarString = _</span><br />
<span style="font-family: courier new;"> &#8220;privatekey=&#8221; &amp; privkey &amp; _</span><br />
<span style="font-family: courier new;"> &#8220;&amp;remoteip=&#8221; &amp; Request.ServerVariables(&#8220;REMOTE_ADDR&#8221;) &amp; _</span><br />
<span style="font-family: courier new;"> &#8220;&amp;challenge=&#8221; &amp; rechallenge &amp; _</span><br />
<span style="font-family: courier new;"> &#8220;&amp;response=&#8221; &amp; reresponse</span></p>
<p><span style="font-family: courier new;"> Dim objXmlHttp</span><br />
<span style="font-family: courier new;"> Set objXmlHttp = Server.CreateObject(&#8220;Msxml2.ServerXMLHTTP&#8221;)</span><br />
<span style="font-family: courier new;"> objXmlHttp.open &#8220;POST&#8221;, &#8220;http://api-verify.recaptcha.net/verify&#8221;,False</span><br />
<span style="font-family: courier new;"> objXmlHttp.setRequestHeader &#8220;Content-Type&#8221;, &#8220;application/x-www-form-urlencoded&#8221;</span><br />
<span style="font-family: courier new;"> objXmlHttp.send VarString</span></p>
<p><span style="font-family: courier new;"> Dim ResponseString</span><br />
<span style="font-family: courier new;"> ResponseString = split(objXmlHttp.responseText, vblf)</span><br />
<span style="font-family: courier new;"> Set objXmlHttp = Nothing</span><br />
<span style="font-family: courier new;"> if ResponseString(0) = &#8220;true&#8221; then</span><br />
<span style="font-family: courier new;"> &#8216;They answered correctly</span><br />
<span style="font-family: courier new;"> recaptcha_confirm = TRUE</span><br />
<span style="font-family: courier new;"> else</span><br />
<span style="font-family: courier new;"> &#8216;They answered incorrectly</span><br />
<span style="font-family: courier new;"> recaptcha_confirm = ResponseString(1)</span><br />
<span style="font-family: courier new;"> end if</span><br />
<span style="font-family: courier new;">end function </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.leinadium.com/code/re-captcha-for-classic-asp-in-vbscript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

