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

Password problem

Status
Not open for further replies.

dip

Programmer
Aug 15, 2000
20
SG
Hai,

I have created a password page following the codes given previously in this forum. Unfortunately it doesn't work. I have changed some of the fields. Rather than the user keying in the name...they are supposed to choose the name from a drop down menu...and then the user has to type in the password. There is no error messages generated. It just accepts the codes. It never goes to the page which it should go after clicking the button.


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

<cfparam name=&quot;action&quot; default=&quot;&quot;>
<html>
<head><title>Login</title></head>
<body>
<cfif action is &quot;login&quot;>
<cfquery name=&quot;checklogin&quot; datasource=&quot;Producer&quot;>
select * from password
where loginID='#loginID#'
and loginpass='#loginpass#'
</cfquery>
<cfif checklogin.recordcount>
<cfset session.logged=1>
<cfset session.loginID=form.loginID>
<cflocation url=&quot;menu_index.cfm&quot; addtoken=&quot;yes&quot;>
<cfelse>
Wrong password!Please re-enter.
</cfif>
</cfif>

<CENTER>
<H1>
Login Menu
</H1>
</CENTER>

<center>
<cfform action=&quot;login.cfm&quot; method=&quot;post&quot;>
<table border=&quot;2&quot; bgcolor=&quot;#FFFFCC&quot;>
<tr>
<th align=&quot;right&quot;>
<tr>
<td nowrap>
<div align=&quot;right&quot;> <font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;>
<b>Name :</b></font></div>
</td>
<td><font size=&quot;2&quot;>
<Select name=&quot;loginID&quot; size=1>
<option value=&quot;name1&quot;>name1
<option value=&quot;name2&quot;>name2
<option value=&quot;name3&quot;>name3
<option value=&quot;name4&quot;>name4
<option value=&quot;name5&quot;>name5
<option value=&quot;name6&quot;>name6
<option value=&quot;name7&quot;>name7
<option value=&quot;name8&quot;>name8
</select><br>
</font></td>
</tr>

<tr>
<th align=&quot;right&quot;>
Password:
</th>
<td>
<cfinput type=&quot;password&quot; name=&quot;loginpass&quot; size=&quot;20&quot; maxlength=&quot;20&quot; required=&quot;Yes&quot;
message=&quot;Password is required!&quot;>
</td>
</tr>

<tr>
<th colspan=&quot;2&quot;>
<input type=&quot;submit&quot; value=&quot;login&quot;>
</th>
</tr>
</table>
</center>
</body>
</cfform>
</html>


The application page:

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


Other pages:

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


How am i going to know if name1's password is so and so?

regards,
dip.


 
Check out Cold Fusion Developer's Journal for August 2000 ( There's great article by Kelly Brown, 'Security Made Simple', which shows you how to create the login file. If you don't get the Journal, let me know and I'll send you the code.
 
Hai,

I could not find the journal - August 2000. I would appreciate if you could send me the code. Thank You.

dip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top