| | |
Register page problem.
Please support our ColdFusion advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Apr 2009
Posts: 7
Reputation:
Solved Threads: 0
I am so confused, I want to add some anti-spam security to my upcoming register page but something is really wrong.
Note that my server is Coldfusion MX7 (i can not afford better) and because of that i can not use
cfimage(captcha).
This is what i have:
this is just testing code but it is somehow messed up.
every time when i click on the submit button i get not equal!
I also need to add when i set up strPassword manualy instead of ArrayToList, for example
<cfset strPassword=test413> and then insert in form test413 and compare it everything is fine. You can copy/paste this code to test it. Any ideas please?
Note that my server is Coldfusion MX7 (i can not afford better) and because of that i can not use
cfimage(captcha).
This is what i have:
ColdFusion Syntax (Toggle Plain Text)
<cfset strLowerCaseAlpha = "abcdefghijklmnopqrstuvwxyz"> <cfset strUpperCaseAlpha = UCase( strLowerCaseAlpha )> <cfset strNumbers = "0123456789"> <cfset strAllValidChars = ( strLowerCaseAlpha & strUpperCaseAlpha & strNumbers )> <cfset arrPassword = ArrayNew( 1 )> <cfset arrPassword[ 1 ] = Mid( strNumbers, RandRange( 1, Len( strNumbers ) ), 1 )> <cfset arrPassword[ 2 ] = Mid( strLowerCaseAlpha, RandRange( 1, Len( strLowerCaseAlpha ) ), 1 )> <cfset arrPassword[ 3 ] = Mid( strUpperCaseAlpha, RandRange( 1, Len( strUpperCaseAlpha ) ), 1 )> <cfloop index="intChar" from="#(ArrayLen( arrPassword ) + 1)#" to="8" step="1"> <cfset arrPassword[ intChar ] = Mid( strAllValidChars, RandRange( 1, Len( strAllValidChars ) ), 1 )> </cfloop> <cfset strPassword = ArrayToList( arrPassword, "" )> <cfif IsDefined("FORM.spamcode")> <cfif form.spamcode neq strPassword > not equal <cfelse> finally working </cfif> </cfif> <cfif isdefined ("strPassword")> <cfoutput>#strPassword#</cfoutput> </cfif> <form action="" method="post"> <label> <input type="text" name="spamcode" id="spamcode" /> </label> </form>
this is just testing code but it is somehow messed up.
every time when i click on the submit button i get not equal!
I also need to add when i set up strPassword manualy instead of ArrayToList, for example
<cfset strPassword=test413> and then insert in form test413 and compare it everything is fine. You can copy/paste this code to test it. Any ideas please?
•
•
•
•
I am so confused, I want to add some anti-spam security to my upcoming register page but something is really wrong.
Note that my server is Coldfusion MX7 (i can not afford better) and because of that i can not use
cfimage(captcha).
This is what i have:
ColdFusion Syntax (Toggle Plain Text)
<cfset strLowerCaseAlpha = "abcdefghijklmnopqrstuvwxyz"> <cfset strUpperCaseAlpha = UCase( strLowerCaseAlpha )> <cfset strNumbers = "0123456789"> <cfset strAllValidChars = ( strLowerCaseAlpha & strUpperCaseAlpha & strNumbers )> <cfset arrPassword = ArrayNew( 1 )> <cfset arrPassword[ 1 ] = Mid( strNumbers, RandRange( 1, Len( strNumbers ) ), 1 )> <cfset arrPassword[ 2 ] = Mid( strLowerCaseAlpha, RandRange( 1, Len( strLowerCaseAlpha ) ), 1 )> <cfset arrPassword[ 3 ] = Mid( strUpperCaseAlpha, RandRange( 1, Len( strUpperCaseAlpha ) ), 1 )> <cfloop index="intChar" from="#(ArrayLen( arrPassword ) + 1)#" to="8" step="1"> <cfset arrPassword[ intChar ] = Mid( strAllValidChars, RandRange( 1, Len( strAllValidChars ) ), 1 )> </cfloop> <cfset strPassword = ArrayToList( arrPassword, "" )> <cfif IsDefined("FORM.spamcode")> <cfif form.spamcode neq strPassword > not equal <cfelse> finally working </cfif> </cfif> <cfif isdefined ("strPassword")> <cfoutput>#strPassword#</cfoutput> </cfif> <form action="" method="post"> <label> <input type="text" name="spamcode" id="spamcode" /> </label> </form>
this is just testing code but it is somehow messed up.
every time when i click on the submit button i get not equal!
I also need to add when i set up strPassword manualy instead of ArrayToList, for example
<cfset strPassword=test413> and then insert in form test413 and compare it everything is fine. You can copy/paste this code to test it. Any ideas please?
Try the code below and you will see what I am saying:
Coldfusion Syntax (Toggle Plain Text)
<cfif IsDefined("FORM.spamcode")> We are comparing <cfoutput>#form.spamcode# with #strPassword# which happens to be the NEW spamcode</cfoutput><br /> <cfif form.spamcode neq strPassword > not equal <cfelse> finally working </cfif> </cfif>
Last edited by cheapterp; Aug 21st, 2009 at 9:50 am.
In your form declare a hidden type input and set it to 'strPassword'
and then change the comparison <cfif> to
Keep in mind though - Hidden type fields are visible when you do a 'View Source' on the page. Therefore sensitive data should not be passed through them.
<input type="hidden" name="OldCode" value="<cfoutput>#strPassword#</cfoutput>" /> and then change the comparison <cfif> to
<cfif Compare(FORM.spamcode, FORM.OldCode)> Keep in mind though - Hidden type fields are visible when you do a 'View Source' on the page. Therefore sensitive data should not be passed through them.
•
•
Join Date: Apr 2009
Posts: 7
Reputation:
Solved Threads: 0
similar idea came to me. i figured out it has something to do with page
refresh. It's perfectly clear now, you explained it well in your first post.
Problem is i still can not make it work. I tried several things with cfifs and cfaborts and somehow, for some reason i didn't succeed. I will keep trying.
i already tried Compare and same! also your code from second post doesn't seem to be working as it supose to. problem still persist.
refresh. It's perfectly clear now, you explained it well in your first post.
Problem is i still can not make it work. I tried several things with cfifs and cfaborts and somehow, for some reason i didn't succeed. I will keep trying.
i already tried Compare and same! also your code from second post doesn't seem to be working as it supose to. problem still persist.
Last edited by pirula; Aug 21st, 2009 at 4:22 pm.
![]() |
Similar Threads
- PHP problem - register page (PHP)
- having a weird problem on registration page (PHP)
- How to register page for a web user control codebehind?? (ASP.NET)
- register page using SQL server (VB.NET)
- Hotmail ONLY accessing page problem -- Only with one account (Web Browsers)
- about:blank Trusted Start Page problem (Viruses, Spyware and other Nasties)
- DSO Exploit + VX2/F problem along with brower home page problem (Viruses, Spyware and other Nasties)
Other Threads in the ColdFusion Forum
- Previous Thread: login password problems
- Next Thread: XSS and SQL Injection
| Thread Tools | Search this Thread |





