Advertisement

03.05.2007 at 09:57AM PST, ID: 22428795
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

forum spam protector, number compare

Asked by tikkanen in Cold Fusion Markup Language

Tags: , ,

I have made somekind of spamprotector with coldfusion in my forum, something like LylaCaptcha. That idea is simple, system sums up two number and compares that anwer and user answer.
something like generate 2 random numbers between 0 and 9.  then output them as such:
what is #rand1# + #rand2#? with a text input for the user to answer (and a hidden input with the answer to match up on the action page).
And then if answer is right user can go forward and write his messages. But it not working, spam messages still comes through. here is my codes.

ask number
<cfset numero1 = "#randrange(1,10)#" />   <<<<<<<<<<<<<<<<<<<< number1
<cfset numero2 = "#randrange(1,10)#" /> <<<<<<<<<<<<<<<<<<<< number2
<CFSET yhteensa=numero1 + numero2>
<cfoutput>Seuraavaa tarkistusta k&auml;ytet&auml;&auml;n &quot;spam bottien&quot;
  est&auml;miseen.<br>
  how much is #numero1# + #numero2# ?</cfoutput><br>
<br>
Syötä vastauksesi sy&ouml;tt&ouml;kentt&auml;&auml;n ja paina ok: <br>
<input name="luku" type="text" size="10"><br> <<<<<<<<<<<<<<<<< user answer
      <cfoutput>
      <INPUT TYPE = "hidden" NAME="summa" Value = "#yhteensa#">  <<<<<<<<<<<<<<<<<<<< sum
      </cfoutput>


action page:

<cfif(#form.luku# IS #form.summa#)>    
<cfparam name="Reply" default="N">
<cfquery name="check_forum" datasource="#datasource#">
      SELECT AllowHTML FROM ForumList
      WHERE ForumID = #ForumID#
</cfquery>
<CFSET form.Body = replace(form.Body,"#Chr(13)##Chr(10)#", "<br>", "ALL")>
<cfquery name="post_topic" datasource="#datasource#">
      INSERT INTO ForumThreads
            (DateIn,ForumID,Thread,Parent, Author,LastPost,Subject,Reply,Body)
      VALUES (#CreateODBCDateTime("#Now()#")#,#ForumID#,#Thread#,#ThreadID#,'#form.Author#', #CreateODBCDateTime("#Now()#")#,'#form.Subject#','#Reply#','#form.Body#')
</cfquery>
<cfquery name="update_forum_1" datasource="#datasource#">
      SELECT ThreadID FROM ForumThreads
      WHERE ForumID = #ForumID# AND Parent = 0
</cfquery>
<cfquery name="update_forum_2" datasource="#datasource#">
      SELECT ThreadID FROM ForumThreads
      WHERE ForumID = #ForumID#
</cfquery>
<cfquery name="update_forum_3" datasource="#datasource#">
      UPDATE ForumList
            Set NumOfTopics=#update_forum_1.RecordCount#,
            NumOfPosts=#update_forum_2.RecordCount#,
            LastPost=#CreateODBCDateTime("#Now()#")#
      WHERE ForumID = #ForumID#
</cfquery>
<cfquery name="update_forum_4" datasource="#datasource#">
      UPDATE ForumThreads
            Set LastPost=#CreateODBCDateTime("#Now()#")#
      WHERE Thread = #Thread# AND Parent = 0
</cfquery>


<cflocation url="katso_aihe.cfm?ForumID=#ForumID#" addtoken="No">
<CFELSE>
<!-- if not equal then do this -->
    <script>
         alert("answer isn't right");
         self.location="index.cfm";
         
    </script>

</cfif>

Start Free Trial
 
 
[+][-]03.10.2007 at 07:57PM PST, ID: 18696154

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Cold Fusion Markup Language
Tags: 0, coldfusion, equal
Sign Up Now!
Solution Provided By: Ennio
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.11.2007 at 09:57AM PDT, ID: 18697620

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32