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 "-//W3C//DTD HTML 4.0 Transitional//EN">
<cfparam name="action" default="">
<html>
<head><title>Login</title></head>
<body>
<cfif action is "login">
<cfquery name="checklogin" datasource="Producer">
select * from password
where loginID='#loginID#'
and loginpass='#loginpass#'
</cfquery>
<cfif checklogin.recordcount>
<cfset session.logged=1>
<cfset session.loginID=form.loginID>
<cflocation url="menu_index.cfm" addtoken="yes">
<cfelse>
Wrong password!Please re-enter.
</cfif>
</cfif>
<CENTER>
<H1>
Login Menu
</H1>
</CENTER>
<center>
<cfform action="login.cfm" method="post">
<table border="2" bgcolor="#FFFFCC">
<tr>
<th align="right">
<tr>
<td nowrap>
<div align="right"> <font face="Arial, Helvetica, sans-serif" size="2">
<b>Name :</b></font></div>
</td>
<td><font size="2">
<Select name="loginID" size=1>
<option value="name1">name1
<option value="name2">name2
<option value="name3">name3
<option value="name4">name4
<option value="name5">name5
<option value="name6">name6
<option value="name7">name7
<option value="name8">name8
</select><br>
</font></td>
</tr>
<tr>
<th align="right">
Password:
</th>
<td>
<cfinput type="password" name="loginpass" size="20" maxlength="20" required="Yes"
message="Password is required!">
</td>
</tr>
<tr>
<th colspan="2">
<input type="submit" value="login">
</th>
</tr>
</table>
</center>
</body>
</cfform>
</html>
The application page:
<CFAPPLICATION NAME="login"
CLIENTMANAGEMENT="Yes"
SESSIONMANAGEMENT="Yes">
Other pages:
<CFIF NOT IsDefined("session.logged">
<CFLOCATION URL="login.cfm">
</CFIF>
How am i going to know if name1's password is so and so?
regards,
dip.
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 "-//W3C//DTD HTML 4.0 Transitional//EN">
<cfparam name="action" default="">
<html>
<head><title>Login</title></head>
<body>
<cfif action is "login">
<cfquery name="checklogin" datasource="Producer">
select * from password
where loginID='#loginID#'
and loginpass='#loginpass#'
</cfquery>
<cfif checklogin.recordcount>
<cfset session.logged=1>
<cfset session.loginID=form.loginID>
<cflocation url="menu_index.cfm" addtoken="yes">
<cfelse>
Wrong password!Please re-enter.
</cfif>
</cfif>
<CENTER>
<H1>
Login Menu
</H1>
</CENTER>
<center>
<cfform action="login.cfm" method="post">
<table border="2" bgcolor="#FFFFCC">
<tr>
<th align="right">
<tr>
<td nowrap>
<div align="right"> <font face="Arial, Helvetica, sans-serif" size="2">
<b>Name :</b></font></div>
</td>
<td><font size="2">
<Select name="loginID" size=1>
<option value="name1">name1
<option value="name2">name2
<option value="name3">name3
<option value="name4">name4
<option value="name5">name5
<option value="name6">name6
<option value="name7">name7
<option value="name8">name8
</select><br>
</font></td>
</tr>
<tr>
<th align="right">
Password:
</th>
<td>
<cfinput type="password" name="loginpass" size="20" maxlength="20" required="Yes"
message="Password is required!">
</td>
</tr>
<tr>
<th colspan="2">
<input type="submit" value="login">
</th>
</tr>
</table>
</center>
</body>
</cfform>
</html>
The application page:
<CFAPPLICATION NAME="login"
CLIENTMANAGEMENT="Yes"
SESSIONMANAGEMENT="Yes">
Other pages:
<CFIF NOT IsDefined("session.logged">
<CFLOCATION URL="login.cfm">
</CFIF>
How am i going to know if name1's password is so and so?
regards,
dip.