{"id":254,"date":"2008-02-17T12:38:57","date_gmt":"2008-02-17T03:38:57","guid":{"rendered":"https:\/\/fugutabetai.com\/blog\/2008\/02\/17\/dave-your-forms-are-evil\/"},"modified":"2008-02-17T12:38:57","modified_gmt":"2008-02-17T03:38:57","slug":"dave-your-forms-are-evil","status":"publish","type":"post","link":"https:\/\/fugutabetai.com\/blog\/2008\/02\/17\/dave-your-forms-are-evil\/","title":{"rendered":"Dave, your forms are EVIL!"},"content":{"rendered":"<p>A while ago, I got this email from a friend of mine:<\/p>\n<blockquote><p>\ni left a long comment on your starbucks entry, but i got a character wrong in your CAPTCHA, and it told me to click the &#8220;back&#8221; button and try again. however, when i did that, all the entries in the form were BLANK! I LOST MY COMMENT! AIEEEE!!!!!\n<\/p><\/blockquote>\n<p>This is a problem, because I don&#8217;t like evil in any form.  Particularly in my forms.  I&#8217;ve been really busy, but spent about thirty minutes poking around at the bBlog internals (looks I chose a bad horse: the bBlog project seems to have died!) and made the field values sticky on an error with the captcha submission.  <\/p>\n<p><P\/><\/p>\n<p>If you are interested in the changes, here is a diff file that you can apply via patch:<br \/>\n<code>patch -b bBlog.class.php bBlog.captcha.diff<\/code> against an unmodified version 0.7.6 bBlog.class.php from the bBlog install.  <\/p>\n<p><P\/><\/p>\n<p>Once that is done, you have to modify your template to add value=&#8221;{$commentFieldPosterXXX}&#8221; where XXX is some value.  The only exception is {$commentreplytitle} which remains the same.<\/p>\n<p><P\/><\/p>\n<p>Here is the relevant portion from my template:<\/p>\n<p><code><PRE><br \/>\n&lt;div class=\"formleft\"&gt;Comment Title&lt;\/div&gt;<br \/>\n&lt;div class=\"formright\"&gt;&lt;input name=\"title\" size=\"80\" type=\"text\" id=\"title\" value=\"{$commentreplytitle}\"\/&gt;&lt;\/div&gt;<br \/>\n&lt;div class=\"clear\"&gt;&nbsp;&lt;\/div&gt;<br \/>\n&lt;div class=\"formleft\"&gt;Your Name: &lt;\/div&gt;<br \/>\n&lt;div class=\"formright\"&gt;&lt;input name=\"name\" size=\"80\" type=\"text\" id=\"author\" value=\"{$commentFieldPosterName}\"\/&gt;&lt;\/div&gt;<br \/>\n&lt;div class=\"clear\"&gt;&nbsp;&lt;\/div&gt;<br \/>\n&lt;div class=\"formleft\"&gt;Email Address: &lt;\/div&gt;<br \/>\n&lt;div class=\"formright\"&gt;&lt;input name=\"email\" size=\"80\" type=\"text\" id=\"email\" value=\"{$commentFieldPosterEmail}\"\/&gt;<br \/>\n          Make Public? &lt;input class=\"checkbox\" name=\"public_email\" type=\"checkbox\" id=\"public_email\" value=\"1\" checked=\\<br \/>\n\"checked\"\/&gt;&lt;\/div&gt;<br \/>\n&lt;div class=\"clear\"&gt;&nbsp;&lt;\/div&gt;<br \/>\n&lt;div class=\"formleft\"&gt;Website: &lt;\/div&gt;<br \/>\n&lt;div class=\"formright\"&gt;&lt;input name=\"website\" size=\"80\" type=\"text\" id=\"url\" value=\"{$commentFieldPosterWebsite}\" \/&gt;<br \/>\n          Make Public? &lt;input class=\"checkbox\" name=\"public_website\" type=\"checkbox\" id=\"public_website\" value=\"1\" chec\\<br \/>\nked=\"checked\" \/&gt;&lt;\/div&gt;<br \/>\n&lt;div class=\"clear\"&gt;&nbsp;&lt;\/div&gt;<br \/>\n&lt;div class=\"formleft\"&gt;&lt;img src=\"\/randomImage.php\" alt=\"verification image\"&gt;&lt;br&gt;Image verification:&lt;\/div&gt;<br \/>\n&lt;div class=\"formright\"&gt;&lt;font color=\"red\"&gt;{$commentFieldError}&lt;\/font&gt;&lt;\/div&gt;<br \/>\n&lt;div class=\"formright\"&gt;&lt;input name=\"verification\" type=\"text\" id=\"verification\" \/&gt;&lt;\/div&gt;<br \/>\n&lt;div class=\"clear\"&gt;&nbsp;&lt;\/div&gt;<br \/>\n&lt;div class=\"formleft\"&gt;Comment:&lt;\/div&gt;<\/p>\n<p>&lt;div class=\"formright\"&gt;&lt;textarea name=\"comment\" cols=\"80\" rows=\"10\" wrap=\"VIRTUAL\" id=\"text\"&gt;<br \/>\n{$commentFieldPosterComment}&lt;\/textarea&gt;&lt;\/div&gt;<br \/>\n<\/PRE><br \/>\n<\/code><\/p>\n<p>Of course, you also need to follow the relevant directions in <a href=\"http:\/\/fugutabetai.com\/?postid=73\">my original post on adding a captcha for comment protection in bblog<\/a>.  But it looks like things are working well for me here.<\/p>\n<p><P\/><\/p>\n<p><a href=\"http:\/\/FuguTabetai.com\/docs\/bBlog.captcha.diff\">The diff patch is here.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while ago, I got this email from a friend of mine: i left a long comment on your starbucks entry, but i got a character wrong in your CAPTCHA, and it told me to click the &#8220;back&#8221; button and try again. however, when i did that, all the entries in the form were BLANK! [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,5],"tags":[],"_links":{"self":[{"href":"https:\/\/fugutabetai.com\/blog\/wp-json\/wp\/v2\/posts\/254"}],"collection":[{"href":"https:\/\/fugutabetai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fugutabetai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fugutabetai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fugutabetai.com\/blog\/wp-json\/wp\/v2\/comments?post=254"}],"version-history":[{"count":0,"href":"https:\/\/fugutabetai.com\/blog\/wp-json\/wp\/v2\/posts\/254\/revisions"}],"wp:attachment":[{"href":"https:\/\/fugutabetai.com\/blog\/wp-json\/wp\/v2\/media?parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fugutabetai.com\/blog\/wp-json\/wp\/v2\/categories?post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fugutabetai.com\/blog\/wp-json\/wp\/v2\/tags?post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}