ColdFusion Tips and Tutorials

ColdFusion Tips and Tutorials. Tips on ColdFusion, AJAX, CSS, JavaScript, HTML, Design, and more.

CFUnited Developer Conference 2010
Use this code TIPSCUST to get $100 off your registration @ CFUnited! We'll see you There!


ColdFusion Tips
Page 1 2 3
148 ColdFusion, Ajax, FuseBox, Tips, and Tut
147 Included Point of View
146 Javascript - OnFocus
145 Nathan's Rules of Professional Web Desig
144 Universal Server-Side Check | Bandwidth
143 Meeting Schedule | Identification Sessio
142 Breaking Frames Without Javascript
141 Unreal Forms
140 Screen Resolution
139 Human Help
138 Better Server-Side Validation
137 Automatic Server-Side Validation
136 Regular Expression Laboratory,ColdFusion
135 Rank-Ordered Site Search
134 Building Cryptograms
133 Well-Formed Includes
132 Grouping Families for Visits
131 Display Families on a Map Grid
130 Slide Shows
129 Determine Your Database Engine
128 ColdFusion in Context: Maxlength Lies
127 Something Extra
126 Parsing Database Structure from Data Def
125 Valid Values Maintenance
124 Print 1
123 Hide Session Id
122 Downsizing Data to Access
121 Time to Load a Page, FuseBox 4
120 Order and Rank by Subset
119 Warn through E-mail & Update on Paste Sp
118 Paste Spreadsheets, ColdFusion Component
117 Review Files Having Fixed-Length Fields
116 Organized Help
115 Sequence Slider
114 Bad Bits
113 Logical Deduction
112 Whiteout
111 Forced Navigation
110 Managing Permissions
109 Time Travel
108 Test First
107 Get Distance Between Map Coordinates
106 Validating Checkboxes
105 Matrix Manipulation
104 Field Help
103 Fake Object Not Found
102 Rank Order Correlation Coefficient
101 From Calling Pairs to Calling Tree
100 Posting Notice
99 Logout Persuasion
98 Release Session Memory
97 Use Identically Named Fields
96 Web Bug
95 Password Generation
94 Core Queries
93 Use CFFTP
92 Insert, Update, and Delete
91 Stack
90 T-Value
89 Bulk Data Entry and E-mail Validation
88 Quick Reset
87 Design 1
86 Use CFFTP
85 Support Login with AutoPost
84 Login and Site Protection
83 XY Graphs in a Graphing Calculator
82 Read Encrypted Files
81 Showing Progress
80 Frugal Cross-Browser Javascript
79 Tabbed Folders
Page 1 2 3



Custom Search
ColdFusion TIPS PLUS


Issue 00085 http://www.cftipsplus.com

I. My Comments

II. ColdFusion In Context: Support Login with AutoPost
By R. Martin Ladner
martin.ladner@knology.net


I. Comments:

Hope you have a Happy New Year.


Keep Coding,
Nathan Stanford
President/CEO
C.F. Concepts, Inc.
http://www.coldfusionmonthly.com
http://www.cftipsplus.com

If you have suggestions for articles send them to us.
If you would like to write for cftipsplus.com
send us an email to:

admin@cftipsplus.com

IF YOU WANT TO BE AN AUTHOR SEND IN YOUR COLDFUSION TIPS.

Remember this is a great way to get your name known in the
ColdFusion Community.



Advanced, Intensive ColdFusion Training!

Visit this site. If you have plans to get training here is a company that provides Advanced, Intensive ColdFusion Training. Check them out.

http://www.coldfusiontraining.com/index.cfm?ref=cftipsplus



CFM - The ColdFusion Monthly!
http://www.ColdFusionMonthly.com

By becoming a .CFM subscriber, you'll receive. ColdFusion information you will not find anywhere else:
Tips, tricks, techniques, strategies, and a wealth of knowledge you will be able to apply immediately to your work, all from established developers.

Monthly access to new articles written by industry-leading ColdFusion experts. A fully-functional application that accompanies each issue.

Full access to all issues, past and present (with a one year paid subscription). The chance to be seen in our "Community Spotlight" corner, which showcases new writers and emerging talent


If you have any suggestions please email me at cftips@nsnd.com.


II. ColdFusion in Context: Support Login with AutoPost
By R. Martin Ladner
martin.ladner@knology.net


Suppose you want to change pages automatically during the login process and pass information to the target page. If you're bouncing the user back to the login page, how will you do it? You could write it to a cookie, but you probably don't want to. You could stick it in a URL, but that might interfere with trying to log in again. You could leave an identifier alone that you automatically used at login (a cookie or URL, for example) and use that identifier to pull data from the server, but you probably don't want to let someone who failed to log in retain an identifier pointing to server resources. One answer to this dilemma is to use javascript to automatically submit a form to your target page.

Make a Home Page
Make a trivial login page that displays a message if the login was bad and accepts a username and password; call it home.cfm. The message, if any, will come from the page used to check the login attempt.

<cfif isDefined("form.msg")>
<cfoutput>#form.msg#</cfoutput><p>
</cfif>
(The username and password must each start with "f" for this example.)<br>
<form name="Entry" action="gate.cfm" method="post">
Username <input type="text" name="Username">
Password <input type="Password" name="Password">
<input type="submit" name="doit" value="Log in">
</form>

Make the Gate with AutoPost
Make a page that will check the login attempt and route the user accordingly; call it gate.cfm. Set variables to the full URL of the pages you might want to go to. Create an almost trivial form for javascript to work with. Then write javascript appropriate to the context: login OK or not OK. Have the javascript submit the form after filling in form variables as desired.

<cfset request.homepage="http://www.futureec.com/context/autopost/login.cfm">
<cfset request.workpage="http://www.futureec.com/context/autopost/work.cfm">

<form name="myFlag" method="post">
<input type="hidden" name="msg">
</form>
<cfset Problem=""> <!--- start with none --->

<script language="javascript">
<cfif not isDefined("form.Username") or (len(form.Username) lt 1)>
<cfset Problem="Missing Username">
<cfelseif not isDefined("form.Password") or (len(form.Password) lt 1)>
<cfset Problem="Missing Password">
<cfelseif (ucase(left(form.Username,1)) is not "F") or (ucase(left(form.Password,1)) is not "F")>
<cfset Problem="Login is not correct">
<cfelse>
document.myFlag.action=<cfoutput>"#request.workpage#"</cfoutput>;
document.myFlag.submit();
</script>
</cfif>
document.myFlag.msg.value=<cfoutput>"#Problem#"</cfoutput>;
document.myFlag.action=<cfoutput>"#request.homepage#"</cfoutput>;
document.myFlag.submit();
</script>

Make a Work Page
It doesn't matter what this page contains as long as it's not empty. Call it work.cfm.

This represents the first work page inside your application.

Try it Out; Use the Concept
Go to login.cfm. Try logging in wrong to see what happens. Try logging in right.
Once you're sure this works, include the idea in your sites. Replace the trivial login test with database queries. Set cookies for site navigation and protection. Let the login page pass variables such as page loading time or the refering page to the gate for logging. Let the gate pass such information through to the heart of your site as form variables. The sky's the limit.
=Marty=


Publisher and Creator:
Nathan Stanford,
admin@cftipsplus.com
http://www.cftipsplus.com

Macromedia and ColdFusion are U.S. registered trademarks.


Copyright (c) 2000 - 2001
CFTIPSPLUS.COM and NSND.COM

Permission is granted to circulate this publication via
MANUAL forwarding by email to friends provided that the text is
forwarded in its entirety and no fee is charged.

Photo of Nathan Stanford
Nathan Stanford
LinkedIn

R. Marty Ladner's
Site