Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After 3 attempted logins (Please advise)

Status
Not open for further replies.

shearak

Programmer
Aug 22, 2001
9
0
0
US
How to use cold fusion to close brower after 3 attempted logins? Please advise.
 
You can only close a window which your code has opened. This would be done using Javascript and the window.open object. You could then have a counter of some sort in CF and each time the user attempts to login and fails increment the counter. Then have a small piece of code at the begin of the login script to say if the count equals three close the window. Once again, using Javascript.

<cfif counter EQ 3>
<script>
self.close();
</script>
</cfif>

Best Regards

Andrew
 
How would you go about coding the counter? I am not clear on this.

Thanks again.
 
In your form have a hidden field call counter and add one to it each time. See below.

<cfparam name=&quot;form.counter&quot; default=&quot;0&quot;>

<cfset form.counter = form.counter + 1>

<form action=&quot;myscript.cfm&quot; method=&quot;post&quot;>
Username: <input name=&quot;username&quot; type=&quot;text&quot;><br>
Password: <input name=&quot;password&quot; type=&quot;password&quot;><br>
<input type=&quot;hidden&quot; name=&quot;counter&quot; value=&quot;<cfoutput>#form.counter#</cfoutput>&quot;>
<input type=&quot;submit&quot;>
</form>

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top