Quantcast
Channel: Adobe Community : All Content - ColdFusion
Viewing all articles
Browse latest Browse all 5979

CFLOGIN help Needed

$
0
0

As funding is an issue, my hosting space is currently CF 6, and am stuck with this version for about another year, so I must make the best of it.  I have a big challenge with CFLOGIN.  My goal is to have family members sign into the family site, and have their navigation to go from page to page.  I am baffled as to how to implement cookies, with a backup database to hold their login data, in case their machine is set to not allow cookies.  I've got a lot of people waiting for me to accomplish this!  The code here, is not CFLOGIN, but the book says it will!

 

Right now, the table in the database is named permissions, and the two fields are un and pw.

 

I am typing from the Inside Coldfusion MX book, by John Cummings.  I looked at another book, by Ben Nadel, and typed his code verbatum also.  I triple-checked every character, and things are not working with either code sets.  The site is a family site, and security is not a big issue, but I wish to implement a login, anyway.  I've no SSL (because its just a family site for now).

 

Here's the code from the book by John C. :

The title of this section of the book is "Conditional Logic for Authentication Processing" but things are not clear as to what goes into the application.cfm and what goes into the page.

 

in my application.cfm :

 

<cfapplication name = "dougs_mobile_site"

 

          sessionTimeout = #CreateTimeSpan(0, 0, 0, 60)#

          sessionManagement = "Yes">

 

<CFPARAM

          NAME="family"

          DEFAULT="9130.fam">

 

<CFERROR TYPE="Request" TEMPLATE="oops.cfm">

 

<cfif not IsDefined("LoggedIn")>

                    <cflocation url="login.cfm">

          <cfelse>

                    <cfset LoggedIn="yes">

</cfif>

 

 

my login.cfm page :

 

<HTML>

<HEAD>

<TITLE>Login Page</TITLE>

</HEAD>

<BODY>

<CFINCLUDE TEMPLATE="login_form_.cfm">

</BODY>

</HTML>

 

 

in my cfinclude, named login_form_.cfm :

 

<!--- Remember the requested URL --->

 

<CFSET URL="http://" & cgi.server_name & ":" & cgi.server_port & cgi.script_name>

<CFIF cgi.query_string IS NOT " ">

          <CFSET URL=url & "?#cgi.query_string#">

</CFIF>

<CFOUTPUT>

 

<FORM

     ACTION="#url#"

     METHOD="post">

<TABLE>

          <TR>

                    <TD COLSPAN="2">

                    <HR>

                    </TD>

          </TR>

          <TR>

                    <TD ALIGN="center">

                              <TABLE>

                                        <TR>

                                                  <TD ALIGN="center" COLSPAN="2">

                                                  You are not currently logged into the system.

                                                  </TD>

                                        </TR>

                                        <TR>

                                                  <TD ALIGN="right">

                                                  Username:

                                                  </TD>

                                                  <TD>

                                                  <INPUT TYPE="text" NAME="un">

                                                  </TD>

                                        </TR>

                                        <TR>

                                                  <TD ALIGN="right">

                                                  Password:

                                                  </TD>

                                                  <TD>

                                                  <INPUT TYPE="password" NAME="pw">

                                                  </TD>

                                        </TR>

                                        <TR>

                                                  <TD COLSPAN="2">

                                                  <INPUT TYPE="submit" NAME="send" VALUE="Login">

                                                  </TD>

                                        </TR>

                              </TABLE>

                    </TD>

          </TR>

</TABLE>

</FORM>

 

</CFOUTPUT>


Viewing all articles
Browse latest Browse all 5979

Trending Articles