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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login page for DarkMan

Status
Not open for further replies.

NeoTurtle

Programmer
Aug 25, 2000
38
0
0
US
Hello DarkMan . . . I followed your Login page code and had it working. Then I had to make some modificaitons and now it's not working. Can you please check my code to see where I went wrong?

application.cfm

<CFAPPLICATION NAME=&quot;Login&quot; CLIENTMANAGEMENT=&quot;Yes&quot; SESSIONMANAGEMENT=&quot;Yes&quot;>

login.cfm
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>

<CFPARAM NAME=&quot;Action&quot; DEFAULT=&quot;&quot;>
<HTML>

<HEAD>
<TITLE>
JinMAU - Login
</TITLE>
</HEAD>

<BODY BGCOLOR=&quot;FFFFFF&quot;>

<CFIF ACTION IS &quot;Login&quot;>
<CFQUERY NAME=&quot;CheckLogin&quot; DATASOURCE=&quot;Employees&quot;>
SELECT LoginID, Password
FROM Employees
WHERE LoginID='#LoginID#' AND Password='#Password#'
</CFQUERY>
<CFIF CheckLogin.RecordCount>
<CFSET Session.Logged=1>
<CFSET Session.LoginID=FORM.LoginID>
<CFLOCATION URL=&quot;adminmenu.cfm&quot; ADDTOKEN=&quot;yes&quot;>

<CFELSE>
<CENTER>
<FONT FACE=&quot;&quot; SIZE=&quot;4&quot; STYLE=&quot;font-weight: bold; color: FF0000; text-align: center;&quot;>
Invalid Login ID or password.<BR>
Please check your spelling try again.<BR>
Click here to have it eMailed to you.
</FONT>
</CENTER>
</CFIF>
</CFIF>
<CFOUTPUT>
<FORM NAME=&quot;Login&quot; ACTION=&quot;adminmenu.cfm?CFID=#CFID#&CFTOKEN=#CFTOKEN#&quot; METHOD=&quot;post&quot;>
</CFOUTPUT>
<CENTER>
<H1>
JinMAU Login
</H1>
</CENTER>

<TABLE WIDTH=&quot;110&quot; ALIGN=&quot;CENTER&quot;>
<TR>
<TH BGCOLOR=&quot;000080&quot; WIDTH=&quot;70&quot;>
<FONT COLOR=&quot;FFFFFF&quot;>
<B>
Login ID
</B>
</FONT>
</TH>
<TD WIDTH=&quot;55&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;LoginID&quot;>
</TD>
</TR>
<TR>
<TH BGCOLOR=&quot;000080&quot; WIDTH=&quot;70&quot;>
<FONT COLOR=&quot;FFFFFF&quot;>
<B>
Password
</B>
</FONT>
</TH>
<TD WIDTH=&quot;55&quot;>
<INPUT TYPE=&quot;password&quot; NAME=&quot;password&quot;>
</TD>
</TR>
<TR>
<TD WIDTH=&quot;55&quot;>
</TD>
<TD ALIGN=&quot;LEFT&quot; WIDTH=&quot;55&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;action&quot; VALUE=&quot;Login&quot;>
<INPUT TYPE=&quot;submit&quot; VALUE=&quot; L o g i n &quot; STYLE=&quot;background-color:#99FF66&quot;>
</TD>
</TR>
</TABLE>

<SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot;>
document.Login.LoginID.focus();
</SCRIPT>

</FORM>

</BODY>
</HTML>

all other protected pages
<CFIF NOT IsDefined(&quot;session.logged&quot;)>
<CFLOCATION URL=&quot;login.cfm&quot;>
</CFIF>


Thanks in advance,
-NeoTurtle
 
Where are the errors occuring? What is the output?
 
It just returns to the Login page after logging in . . .

-NeoTurtle
 
You have put the login validation code at login.cfm itself.
But your form action point to another form.

<FORM NAME=&quot;Login&quot; ACTION=&quot;adminmenu.cfm?CFID=#CFID#&CFTOKEN=#CFTOKEN#&quot; METHOD=&quot;post&quot;>

Therefore the above code should be changed to:

<FORM NAME=&quot;Login&quot; ACTION=&quot;login.cfm?CFID=#CFID#&CFTOKEN=#CFTOKEN#?ACTION=login&quot; METHOD=&quot;post&quot;>

Djon
 
gunawandjon,

<CFHAPPY>
ohhhhhhhhhhh!!!!! That's what the problem was!! Thanks a lot!!!
</CFHAPPY>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top