Wesley's random comments about the world and the people and stuff in it.

Wednesday, October 08, 2008

super fast and short login form - coldfusion

Needed to protect one page in 5 minutes, wrote this quicl little 7 line script.

Requires session management to be active on the coldfusion server - this example is being used on a bluedragon server that doesnt require form actions, CF might require a form action


<cfif not isDefined('session.id')>
<cfif isDefined('login')>
<cfif login eq "hardcoded_password_here">
<cfset session.id = login><a href="">Success</a><cfabort></cfif>
</cfif>
<form>Password:
<input name="login">
</form><cfabort>
</cfif>

0 comments:

Twitter / vexcom

LeadFeed